Production accounting
Allocation, royalties, revenue, cost methods, period close and reporting.
In this documentation
- Beep.OilandGas Documentation
- Overview
- Architecture
- BeepDM integration
- Database scripts
- Configuration
- Company and field scoping
- Roles and access
- REST API reference
- Web application pages
- Exploration and prospects
- Development and drilling
- Production operations
- Production accounting
- HSE, permits and compliance
- Decommissioning
- Engineering calculators
- Troubleshooting
Partly implemented. The run ticket allocation in
AllocationEngineimplements only the ProRata method. The code lists the methods ProRata, Equation, Volumetric and Yield as valid names, but for a run ticket any method other than ProRata ends with the error "Allocation method not implemented". Other allocation routines are described in section 2.
The domain code is in Beep.OilandGas.ProductionAccounting, and Beep.OilandGas.Accounting holds the traditional ledger services. Most routes are under /api/accounting and take a connectionName query value that defaults to PPDM39. The field scoped accounting routes under /api/field/current/accounting work on the current field.
1. Period checks and close
A period is checked and closed for the current field. Reading the period checks and closing need the Accountant or Administrator role; closing also needs write access to the field.
| Method | Route | Body | Query | Access |
|---|---|---|---|---|
| GET | /api/field/current/accounting/period-checks | periodEnd, bookId | field access; role Accountant,Administrator | |
| GET | /api/field/current/accounting/recent-activities | field access | ||
| GET | /api/field/current/accounting/production-summary | periodEnd | field access | |
| GET | /api/field/current/accounting/revenue-lines | startDate, endDate | field access | |
| GET | /api/field/current/accounting/close-readiness | periodEnd | field access | |
| GET | /api/field/current/accounting/period-closes | field access | ||
| POST | /api/field/current/accounting/close-period | CloseAccountingPeriodRequest | field access; role Accountant,Administrator; field access WRITE |
2. Allocation
POST /api/accounting/allocation/reconcile reconciles volumes and POST /api/accounting/allocation/allocate allocates them. For a run ticket the engine creates an allocation result, then creates ProRata details and records the allocated total and the variance between the ticket volume and the allocated total.
AllocationEngine.AllocateToWells divides a volume between wells using one of these bases: equal shares, working interest, net revenue interest, measured production or estimated production. The method names Reciprocal, ActivityBasedCosting, StepDown and DirectAllocation exist in the allocation method enumeration, and the code marks them as methods that do not allocate well production. Cost allocation and production allocation routes are:
| Method | Route | Body | Query |
|---|---|---|---|
| POST | /api/accounting/allocation/reconcile | VolumeReconciliationRequest | connectionName |
| POST | /api/accounting/allocation/allocate | AllocationRequest | connectionName |
| POST | /api/accounting/cost/allocations/allocate | CostAllocationRequest | connectionName |
| POST | /api/accounting/cost/allocations/service/allocate | AllocateProductionRequest | connectionName |
| GET | /api/accounting/cost/allocations/service/{allocationId} | connectionName | |
| GET | /api/accounting/cost/allocations/service/{allocationId}/details | connectionName | |
| POST | /api/accounting/cost/allocations/service/{allocationId}/reverse | connectionName | |
| POST | /api/accounting/cost/transactions | CreateCostTransactionRequest | connectionName |
3. Run tickets, storage and pricing
| Method | Route | Body | Query |
|---|---|---|---|
| GET | /api/accounting/pricing/indices | indexName, connectionName | |
| POST | /api/accounting/pricing/indices | PriceIndexRequest | connectionName |
| POST | /api/accounting/pricing/valuateticket | ValueRunTicketRequest | connectionName |
| GET | /api/accounting/production/inventory/{id} | connectionName | |
| POST | /api/accounting/production/inventory | CreateTankInventoryRequest | connectionName |
| GET | /api/accounting/production/runtickets | startDate, endDate, connectionName | |
| GET | /api/accounting/production/runtickets/{id} | connectionName | |
| POST | /api/accounting/production/runtickets | CreateRunTicketRequest | revenueAmount, isCash, connectionName |
| POST | /api/accounting/production/runtickets/service/process-cycle | RUN_TICKET | connectionName |
| GET | /api/accounting/production/runtickets/service/accounting-status/{fieldId} | asOfDate, connectionName | |
| GET | /api/accounting/production/runtickets/service/revenue-transactions/{fieldId} | startDate, endDate, connectionName | |
| GET | /api/accounting/storage/facilities | facilityId, leaseId, connectionName | |
| POST | /api/accounting/storage/facilities | CreateStorageFacilityRequest | connectionName |
| POST | /api/accounting/storage/service/tanks/{tankId}/update | StorageTankInventoryUpdateRequest | connectionName |
| GET | /api/accounting/storage/service/tanks/{tankId} | connectionName | |
| POST | /api/accounting/storage/service/inventory/{inventoryItemId}/valuation | StorageInventoryValuationRequest | connectionName |
| POST | /api/accounting/storage/service/inventory/{inventoryItemId}/reconciliation-report | StorageReconciliationReportRequest | connectionName |
4. Revenue, royalty and tax
Royalty routes cover accrual from an allocation detail, payments against a royalty calculation, posting review, a preview, calculations for a field and period, and royalty disputes that can be created and resolved.
| Method | Route | Body | Query |
|---|---|---|---|
| POST | /api/accounting/revenue/allocations/allocate | RevenueAllocationRequest | connectionName |
| POST | /api/accounting/revenue/transactions | CreateRevenueTransactionRequest | isCash, connectionName |
| POST | /api/accounting/revenue/transactions/service/recognize | ALLOCATION_DETAIL | connectionName |
| POST | /api/accounting/revenue/transactions/service/validate | REVENUE_ALLOCATION | connectionName |
| POST | /api/accounting/royalty/allocations/{allocationDetailId}/accrue | ||
| POST | /api/accounting/royalty/calculations/{royaltyId}/payments | CreateRoyaltyPaymentRequest | |
| GET | /api/accounting/royalty/calculations/{royaltyId}/payments | ||
| GET | /api/accounting/royalty/service/calculations/{royaltyId} | ||
| GET | /api/accounting/royalty/calculations/{royaltyId}/posting-review | ||
| POST | /api/accounting/royalty/disputes | ROYALTY_DISPUTE | connectionName |
| POST | /api/accounting/royalty/disputes/{disputeId}/resolve | ResolveRoyaltyDisputeRequest | connectionName |
| GET | /api/accounting/royalty/disputes | royaltyOwnerBaId, status, connectionName | |
| POST | /api/accounting/royalty/preview | PreviewRoyaltiesRequest | |
| GET | /api/accounting/royalty/calculations | fieldId, startDate, endDate | |
| POST | /api/accounting/tax/production/calculate | REVENUE_TRANSACTION | connectionName |
5. Financial methods
Full cost and successful efforts accounting each have their own routes. Full cost records exploration, development and acquisition costs and performs a ceiling test. Successful efforts records acquisition, exploration, development and production costs, dry holes and impairment. The amortization routes calculate amortization and capitalised interest and convert production and reserves to barrels of oil equivalent.
| Method | Route | Body | Query |
|---|---|---|---|
| POST | /api/accounting/financial/amortization/calculate | AmortizationCalculationRequest | connectionName |
| POST | /api/accounting/financial/amortization/interest-capitalization | InterestCapitalizationData | connectionName |
| POST | /api/accounting/financial/amortization/convert-production-to-boe | ProductionData | connectionName |
| POST | /api/accounting/financial/amortization/convert-reserves-to-boe | ProvedReserves | connectionName |
| POST | /api/accounting/financial/full-cost/exploration-costs | FullCostExplorationRequest | connectionName |
| POST | /api/accounting/financial/full-cost/development-costs | FullCostDevelopmentRequest | connectionName |
| POST | /api/accounting/financial/full-cost/acquisition-costs | FullCostAcquisitionRequest | connectionName |
| GET | /api/accounting/financial/full-cost/cost-center/{costCenterId}/total-costs | connectionName | |
| POST | /api/accounting/financial/full-cost/ceiling-test | CeilingTestRequest | connectionName |
| POST | /api/accounting/financial/successful-efforts/acquisition | UnprovedProperty | connectionName |
| POST | /api/accounting/financial/successful-efforts/exploration-costs | ExplorationCosts | connectionName |
| POST | /api/accounting/financial/successful-efforts/development-costs | DevelopmentCosts | connectionName |
| POST | /api/accounting/financial/successful-efforts/production-costs | ProductionCosts | connectionName |
| POST | /api/accounting/financial/successful-efforts/dry-hole | ExplorationCosts | connectionName |
| POST | /api/accounting/financial/successful-efforts/impairment | ImpairmentRequest | connectionName |
6. Ownership, unitization and trading
| Method | Route | Body | Query |
|---|---|---|---|
| GET | /api/accounting/ownership/interests | propertyOrLeaseId, asOfDate, connectionName | |
| POST | /api/accounting/ownership/interests | RegisterOwnershipInterestRequest | connectionName |
| GET | /api/accounting/trading/exchanges | contractId, connectionName | |
| POST | /api/accounting/trading/exchanges | CreateExchangeContractRequest | connectionName |
| GET | /api/accounting/unitization/units | connectionName | |
| POST | /api/accounting/unitization/units | CreateUnitAgreementRequest | connectionName |
7. Reporting
Reports can be generated, scheduled and distributed: operational, financial, royalty statement, joint interest billing (JIB) statement and lease reports. The history route lists generated reports. A second controller exposes matching routes under /api/accounting/reporting/service.
| Method | Route | Body | Query |
|---|---|---|---|
| POST | /api/accounting/reporting/operational | GenerateOperationalReportRequest | connectionName |
| POST | /api/accounting/reporting/financial | GenerateFinancialReportRequest | connectionName |
| POST | /api/accounting/reporting/royalty-statement | GenerateRoyaltyStatementRequest | connectionName |
| POST | /api/accounting/reporting/jib-statement | GenerateJIBStatementRequest | connectionName |
| POST | /api/accounting/reporting/schedule | ScheduleReportRequest | connectionName |
| GET | /api/accounting/reporting/schedule | connectionName | |
| POST | /api/accounting/reporting/{reportId}/distribute | ReportDistributionRequest | connectionName |
| GET | /api/accounting/reporting/history | reportType, startDate, endDate, connectionName | |
| POST | /api/accounting/reporting/lease | GenerateLeaseReportRequest | connectionName |
| POST | /api/accounting/reporting/service/operational | GenerateOperationalReportRequest | connectionName |
| POST | /api/accounting/reporting/service/financial | GenerateFinancialReportRequest | connectionName |
| POST | /api/accounting/reporting/service/royalty-statement | GenerateRoyaltyStatementRequest | connectionName |
| POST | /api/accounting/reporting/service/jib-statement | GenerateJIBStatementRequest | connectionName |
| POST | /api/accounting/reporting/service/schedule | ScheduleReportRequest | connectionName |
| GET | /api/accounting/reporting/service/schedule | connectionName | |
| POST | /api/accounting/reporting/service/{reportId}/distribute | ReportDistributionRequest | connectionName |
| GET | /api/accounting/reporting/service/history | reportType, startDate, endDate, connectionName |
8. Traditional accounting
General ledger, payables, receivables, invoices, purchase orders, inventory and the company scoped sales invoice, receivable, billing policy and ledger account routes are under /api/accounting/traditional. Accounting permissions such as Accounting.PostJournal, Accounting.ApproveJournal, Accounting.ManagePeriods and Accounting.ReopenPeriods are defined in the permission list.
| Method | Route | Body | Query |
|---|---|---|---|
| GET | /api/accounting/traditional/ap/{id}/correction-decision-review | expectedInvoiceRevision | |
| POST | /api/accounting/traditional/ap/{id}/correction-commands | APInvoiceCorrectionSubmission | |
| POST | /api/accounting/traditional/ap/{id}/correction-review | APInvoiceCorrectionDraft | |
| GET | /api/accounting/traditional/ap/matching-policies | ||
| GET | /api/accounting/traditional/ap/matching-policies/command-review | action | |
| POST | /api/accounting/traditional/ap/matching-policies/commands | CompanyMatchingPolicySubmission | |
| GET | /api/accounting/traditional/ap/{id}/lines/{lineId}/purchase-source | expectedInvoiceRevision | |
| GET | /api/accounting/traditional/ap/{id}/financial-review | expectedInvoiceRevision | |
| POST | /api/accounting/traditional/ap/{id}/variance-proposal-review | APInvoiceVarianceProposal | |
| GET | /api/accounting/traditional/ap/{id}/variance-decision-review | expectedInvoiceRevision | |
| POST | /api/accounting/traditional/ap/{id}/variance-decision-commands | APInvoiceVarianceDecisionSubmission | |
| POST | /api/accounting/traditional/ap/{id}/variance-proposal-commands | APInvoiceVarianceSubmission | |
| GET | /api/accounting/traditional/ap/{id}/lines/{lineId}/receipt-allocations | expectedInvoiceRevision, expectedOrderRevision | |
| POST | /api/accounting/traditional/ap/{id}/lines/{lineId}/receipt-allocation-review | APReceiptAllocationProposal | |
| GET | /api/accounting/traditional/ap/{id}/lines/{lineId}/receipt-consumption | receiptId, expectedInvoiceRevision, expectedOrderRevision | |
| POST | /api/accounting/traditional/ap/{id}/lines/{lineId}/receipt-allocations | APReceiptAllocationSubmission | |
| GET | /api/accounting/traditional/ap/{id} | ||
| GET | /api/accounting/traditional/ap | vendorId | |
| GET | /api/accounting/traditional/ap/vendor/{vendorId}/invoices | ||
| POST | /api/accounting/traditional/ap | ||
| GET | /api/accounting/traditional/ar/{id} | connectionName | |
| POST | /api/accounting/traditional/ar | CreateARInvoiceRequest | connectionName |
| GET | /api/accounting/traditional/gl/company-accounts/books | ||
| GET | /api/accounting/traditional/gl/company-accounts/books/configuration-review | ||
| POST | /api/accounting/traditional/gl/company-accounts/books/configuration | CompanyLedgerBookConfigurationSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/books/configuration/{id} | ||
| GET | /api/accounting/traditional/gl/company-accounts/fx-rates | book, sourceCurrency, date | |
| GET | /api/accounting/traditional/gl/company-accounts/fx-rates/configuration-review | book, sourceCurrency, date, through | |
| POST | /api/accounting/traditional/gl/company-accounts/fx-rates/configuration | CompanyFxRateConfigurationSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/fx-rates/configuration/{id} | ||
| POST | /api/accounting/traditional/gl/company-accounts/mappings/transitions | CompanyGLMappingTransitionSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/mappings/transitions/{id} | book, currency | |
| GET | /api/accounting/traditional/gl/company-accounts/periods/transition-review | book, currency, calendar | |
| POST | /api/accounting/traditional/gl/company-accounts/periods/transitions | CompanyLedgerPeriodTransitionSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/periods/transitions/{periodId}/{intentId} | book, currency, calendar | |
| GET | /api/accounting/traditional/gl/company-accounts/periods | book, currency, calendar | |
| GET | /api/accounting/traditional/gl/company-accounts/periods/configuration-review | book, currency, calendar | |
| POST | /api/accounting/traditional/gl/company-accounts/periods/configuration | CompanyLedgerPeriodCreationSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/periods/configuration/{id}/request | book, currency, calendar | |
| GET | /api/accounting/traditional/gl/company-accounts/configuration-review | book, currency | |
| GET | /api/accounting/traditional/gl/company-accounts/mappings/configuration-review | book, currency, date | |
| POST | /api/accounting/traditional/gl/company-accounts/mappings/configuration | CompanyGLMappingConfigurationSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/mappings/configuration/{id}/request | book, currency | |
| POST | /api/accounting/traditional/gl/company-accounts/configuration | CompanyGLAccountConfigurationSubmission | |
| GET | /api/accounting/traditional/gl/company-accounts/configuration/{id}/request | book, currency | |
| GET | /api/accounting/traditional/gl/company-accounts/mappings | book, currency, date | |
| GET | /api/accounting/traditional/gl/company-accounts | book, currency | |
| GET | /api/accounting/traditional/gl/accounts | connectionName | |
| GET | /api/accounting/traditional/gl/accounts/{id} | connectionName | |
| POST | /api/accounting/traditional/gl/accounts | CreateGLAccountRequest | connectionName |
| POST | /api/accounting/traditional/gl/journal-entries | CreateJournalEntryRequest | connectionName |
| POST | /api/accounting/traditional/gl/journal-entries/{id}/post | connectionName | |
| GET | /api/accounting/traditional/gl/journal-entries/{id} | connectionName | |
| GET | /api/accounting/traditional/invoice | connectionName | |
| GET | /api/accounting/traditional/invoice/{id} | ||
| POST | /api/accounting/traditional/invoice | CreateInvoiceRequest | |
| GET | /api/accounting/traditional/purchase-order/{id}/receipts/{receiptId}/decision-review | ||
| POST | /api/accounting/traditional/purchase-order/{id}/receipts/{receiptId}/decision | PurchaseReceiptDecisionSubmission | |
| GET | /api/accounting/traditional/purchase-order/{id} | ||
| GET | /api/accounting/traditional/purchase-order | vendorId | |
| GET | /api/accounting/traditional/purchase-order/vendor/{vendorId}/orders | ||
| POST | /api/accounting/traditional/purchase-order |
9. Services in the domain project
The ProductionAccounting project contains these service classes: AFE, allocation, amortization, asset swap, borrowing cost capitalization, contract performance, COPAS overhead, decommissioning accounting, drilling scenario accounting, emissions trading, exploration evaluation, financial instruments, full cost, functional currency, imbalance, impairment testing, internal control, inventory, inventory lower of cost and market, joint interest billing, lease economic interest, leasing, measurement, period closing, pricing, production sharing, production tax, reporting, reserve accounting, reserve disclosure, revenue, royalty, royalty dispute, successful efforts, take or pay and unproved property. Not every service has its own REST route; the routes above are the ones exposed.
10. Web pages
| Page | Route |
|---|---|
| Accounting dashboard | /accounting/dashboard, /ppdm39/accounting |
| Track Production Revenue | /accounting/production |
| Accounting period checks | /ppdm39/accounting/period-close |
| Reconcile Oil Run Tickets | /ppdm39/accounting/volume-reconciliation |
| Preview Cost Allocation | /ppdm39/accounting/cost-allocation |
| Recorded revenue source review | /ppdm39/accounting/revenue-recognition |
| Field Royalty Records and Royalty details | /ppdm39/accounting/royalties, /ppdm39/accounting/royalties/{CalculationId} |
| Manage Joint Interest Billing | /ppdm39/accounting/joint-interest-billing |
| Cost, revenue and tax workbenches | /accounting/cost-workbench, /accounting/revenue-workbench, /accounting/tax-workbench |
| Sales invoices, invoice review, receivables, billing policies, ledger accounts | /accounting/sales-invoices, /accounting/sales-invoice-review, /accounting/sales-receivables, /accounting/billing-policies, /accounting/ledger-accounts |
| Company AP invoice sources | /accounting/payables, /accounting/payables/invoices/{Id} |
| Company accounting process | /accounting/processes/{Id} |
| Original saved delivery work | /accounting/delivery-intents/{IntentId} |