Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 930
    • Issues 930
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #1761

Closed
Open
Opened May 13, 2020 by Rich@artfulrobotDeveloper

Should deprecate Financial Type on Contribution records

Overview

Contribution records have a financial type. They also have line items, each of which has a financial type. Typically, a contribution has a single line item, and the financial types of each match. But it's quite possible to have different financial types e.g. contribution and only line item could have different types which does not make sense. Also if a contribution has multiple line items of different types, what should the financial type of the contribution be?

Having financial type on the contribution harks back to simpler times before we allowed line items. But for 90%(?) of cases it doesn't matter much because they're the same. And of course there's a thousand places in core that assumes a single finanical type per contribution, and there's a thousand more in custom code and extensions.

Currently (5.26) you get an api exception if you call Order.create without setting a contribution-level financial type, which is slightly irksome when you're providing line items, not least because it forces new code to do nonsense old stuff, which can lead to developer confusion.

Nb. all the UIs that create contribution records set a financial type to something. This may or may not make sense compared with line items (e.g. it's taken from the priceset).

Proposals

  1. I would like to be able to call Order.create with line items and have it pick the financial type from the first line item to use for the Contribution record. This would not affect any existing processes (with the possible exception of processes that currently crash...!)

  2. I propose that over time (it will be a long time!) we move all reports/searches etc. to go the extra JOIN and inspect the line items for info on financial types instead of using the contribution's single financial type value.

Comments

This is a place to discuss it. Discussion began in mattermost

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#1761