foliolib.folio.api.finance.LedgerRollover

class foliolib.folio.api.finance.LedgerRollover(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Ledger Rollover API

APIs used to manage ledger rollover.

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

get_ledgerRollover(ledgerRolloversId)

Retrieve ledgerRollover item with given {ledgerRolloverId}

get_ledgerRollovers(**kwargs)

Get list of rollovers

set_ledgerRollover(ledgerRollover)

Create a new ledgerRollover item.

get_ledgerRollover(ledgerRolloversId: str)

Retrieve ledgerRollover item with given {ledgerRolloverId}

GET /finance/ledger-rollovers/{ledgerRolloversId}

Parameters

ledgerRolloversId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Ledger fiscal year rollover",
  "type": "object",
  "properties": {
    "id": {
      "description": "id of ledger fiscal year rollover",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "ledgerId": {
      "description": "Ledger UUID for which rollover was started",
      "$ref": "../../common/schemas/uuid.json"
    },
    "rolloverType": {
      "description": "Type of rollover. Action Commit means run real rollover",
      "type": "object",
      "$ref": "../../mod-finance/schemas/ledger_rollover_type.json"
    },
    "fromFiscalYearId": {
      "description": "UUID of the fiscal year from which rollover will be happened",
      "$ref": "../../common/schemas/uuid.json"
    },
    "toFiscalYearId": {
      "description": "UUID of the fiscal year to which rollover will be happened",
      "$ref": "../../common/schemas/uuid.json"
    },
    "restrictEncumbrance": {
      "description": "Imposes restrictions on encumbrances",
      "type": "boolean",
      "default": false
    },
    "restrictExpenditures": {
      "description": "Imposes restrictions on payments",
      "type": "boolean",
      "default": false
    },
    "needCloseBudgets": {
      "description": "Control that all budget must be closed in rollover time",
      "type": "boolean",
      "default": true
    },
    "currencyFactor": {
      "description": "Currency factor",
      "type": "integer",
      "readonly": true
    },
    "budgetsRollover": {
      "description": "Budget rollover info",
      "type": "array",
      "id": "budgetsRollover",
      "items": {
        "type": "object",
        "$ref": "budget_rollover.json"
      }
    },
    "encumbrancesRollover": {
      "description": "Encumbrances rollover info",
      "id": "encumbrancesRollover",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "encumbrance_rollover.json"
      }
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "additionalProperties": false,
  "required": [
    "ledgerId",
    "fromFiscalYearId",
    "toFiscalYearId",
    "budgetsRollover",
    "encumbrancesRollover"
  ]
}
get_ledgerRollovers(**kwargs)

Get list of rollovers

GET /finance/ledger-rollovers

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example code

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • [“code”, “MEDGRANT”, “=”]

  • totalRecords (str) –

    (default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example

    • none

  • offset (int) –

    (default=0) Skip over a number of elements by specifying an offset value for the query

    Example

    • 0

  • limit (int) –

    (default=10) Limit the number of elements returned in the response

    Example

    • 10

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of ledger fiscal year rollovers",
  "type": "object",
  "properties": {
    "ledgerFiscalYearRollovers": {
      "description": "The list of fiscal year rollovers",
      "type": "array",
      "items": {
        "$ref": "ledger_fiscal_year_rollover.json"
      }
    },
    "totalRecords": {
      "description": "The number of records contained in this collection",
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "ledgerFiscalYearRollovers",
    "totalRecords"
  ]
}
set_ledgerRollover(ledgerRollover: dict)

Create a new ledgerRollover item.

POST /finance/ledger-rollovers

Parameters

ledgerRollover (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created ledgerRollover item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Ledger fiscal year rollover",
  "type": "object",
  "properties": {
    "id": {
      "description": "id of ledger fiscal year rollover",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "ledgerId": {
      "description": "Ledger UUID for which rollover was started",
      "$ref": "../../common/schemas/uuid.json"
    },
    "rolloverType": {
      "description": "Type of rollover. Action Commit means run real rollover",
      "type": "object",
      "$ref": "../../mod-finance/schemas/ledger_rollover_type.json"
    },
    "fromFiscalYearId": {
      "description": "UUID of the fiscal year from which rollover will be happened",
      "$ref": "../../common/schemas/uuid.json"
    },
    "toFiscalYearId": {
      "description": "UUID of the fiscal year to which rollover will be happened",
      "$ref": "../../common/schemas/uuid.json"
    },
    "restrictEncumbrance": {
      "description": "Imposes restrictions on encumbrances",
      "type": "boolean",
      "default": false
    },
    "restrictExpenditures": {
      "description": "Imposes restrictions on payments",
      "type": "boolean",
      "default": false
    },
    "needCloseBudgets": {
      "description": "Control that all budget must be closed in rollover time",
      "type": "boolean",
      "default": true
    },
    "currencyFactor": {
      "description": "Currency factor",
      "type": "integer",
      "readonly": true
    },
    "budgetsRollover": {
      "description": "Budget rollover info",
      "type": "array",
      "id": "budgetsRollover",
      "items": {
        "type": "object",
        "$ref": "budget_rollover.json"
      }
    },
    "encumbrancesRollover": {
      "description": "Encumbrances rollover info",
      "id": "encumbrancesRollover",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "encumbrance_rollover.json"
      }
    },
    "metadata": {
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true,
      "type": "object"
    }
  },
  "additionalProperties": false,
  "required": [
    "ledgerId",
    "fromFiscalYearId",
    "toFiscalYearId",
    "budgetsRollover",
    "encumbrancesRollover"
  ]
}