Skip to content

Approvals & factions ​

Business and faction accounts are job society accounts that members may spend from, under rules their boss sets. A mechanic buys parts from the Hayes Autos account; an officer fills up the cruiser from LSPD Expenses.

Which accounts show ​

Account Shows for Config
Faction Members of the job Config.Factions[job]
Business Members of the job Config.Businesses[job] and every Config.Terminal.businesses[job]

The balance comes from the banking resource (np_banking, Renewed-Banking, qb-banking / qb-management, okokBanking or esx_addonaccount). With framework money only, there are no job accounts. See Bridges.

Rules ​

Every member spends under one effective rule. It is built from these layers, later ones win:

  1. Defaults: Config.Rules.defaultLimit ($250 a day), plus categories, blocked and onDutyOnly from the faction or business config
  2. '*': the whole account
  3. 'grade:<n>': one job grade
  4. 'cid:<cid>': one member
Field Description
limit Daily limit for the member. 0 = can't spend (role)
categories Only these categories. nil = all
blocked Never these categories
onduty Only on duty
approvals Over the limit, ask a boss instead of declining
view View only: sees the account, can't spend

Bosses (grade Config.Rules.bossGrade = 4 or higher, or the framework isboss flag) have no limit. The category and duty rules still apply to them.

Spend is counted per member, account and day in np_payments_spend. The day resets at UTC midnight plus Config.Rules.dayOffset hours. If the banking provider manages limits itself (np_banking returns limit on the account for members with a daily limit), np_payments uses that limit and doesn't count spend.

Bosses edit the rules in the Pay app. Rules are stored in np_payments_rules.

Approvals ​

Needs approval

When a payment is over the member's remaining limit and approvals are on, the row shows needs approval and the button reads Hold to request approval. Holding it:

  1. puts the sheet into the Needs approval state with a timer,
  2. sends every online boss of that job (except the payer) a toast: "Aiden wants to spend $1,240 at LS Customs from LSPD Expenses", with Deny (N) and Approve (Y),
  3. adds it to the approval queue in the bosses' Pay app.

The first decision wins. The other bosses get a toast with the outcome. Approved: the payment is charged. Denied, or no decision within 60 s (Config.Approvals.timeout): the payment declines. The timer never runs past the request's own expiry. With no boss online, the payment declines right away with "No boss online to approve".

Without np_hud the toast goes to np_phone, then to chat. np_hud's np_hud:notifyAction event works as a second way to decide (notification id np_payments:approval:<id>).

Charge (no UI) can't ask for approval: an amount over the limit fails with limit.

Example: LSPD ​

lua
Config.Factions.police = {
  label = 'LSPD Expenses', icon = 'shield-halved', tint = 'blue',
  onDutyOnly = true,
  categories = { 'fuel', 'repair', 'food' },
  blocked = {},
}
Config.Rules = { bossGrade = 4, defaultLimit = 250, approvals = true, dayOffset = 0 }

An on-duty officer can pay fuel, repairs and food up to $250 a day from LSPD Expenses. A $1,240 repair asks the captain. In a shop the row shows "Not allowed here"; off duty it shows "Only on duty".