---
name: "LedgerSMB::DBObject::Reconciliation"
section: "3pm"
platform: "linux"
package: "ledgersmb"
version: "1.3.40-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/LedgerSMB::DBObject::Reconciliation"
---

# LedgerSMB::DBObject::Reconciliation(3pm)

LedgerSMB class defining the core database interaction logic for Reconciliation.

## NAME

LedgerSMB::DBObject::Reconciliation - LedgerSMB class defining the core  database interaction logic for Reconciliation.

## SYOPSIS

This module creates object instances based on LedgerSMB's in-database ORM.

## METHODS

Please note, this module needs a lot of cleanup.

- new ($class, base =\> $LedgerSMB::hash)

  This is the base constructor for all child classes.  It must be used with base argument because this is necessary for database connectivity and the like.

  Of course the base object can be any object that inherits LedgerSMB, so you can use any subclass of that.  The per-session dbh is passed between the objects  this way as is any information that is needed.

- get\_report($self, $report\_id)

  Collects all the rows from the database in the given report. Returns an  arrayref of entries in the table for the given report\_id.

  Returns undef in the event of no records found.

- get\_corrections($self, $report\_id, $entry\_id)

  Returns the corrections made for the selected report and entry. Returns undef in the event of no corrections found.

- entry ($self,$report\_id,$entry\_id)

  Returns a single entry from the pending reports table, either cleared or uncleared.

- update

  Updates the report, pulling in any new transactions in the date range into the  transaction list.

- submit

  Submits the reconciliation set for approval.

- save

  Saves the reconciliation set for later work

- import\_file

  Calls the file import function.  This is generally assumed to be a csv file although the plugin is very modular and plugins could be written for other  formats.  The format structure is per account id.

- approve($self,$reportid)

  Approves the pending report `$reportid`. Checks for error codes in the pending report, and approves the report if none are found.

  Limitations: The creating user may not approve the report.

  Returns 1 on success.

- new\_report

  Creates a new report with data entered.

- delete ($self, $report\_id)

  Requires report\_id

  This will allow the deletion of a report if the report is not approved and  the user either owns the unsubmitted report, or the user has the right to  approve reports.

  Returns 0 if successful, or a true result if not.

- add\_entries

  Adds entries from the import file routine.

  This function is extremely order dependent.  Meaningful scn's must be submitted  first it is also recommended that amounts be ordered where scn's are not found.

- search

  Searches for reconciliation reports.  No inputs mandatory.

  date\_from and date\_to specify ranges. balance\_from and balance\_to specify ranges chart\_id specifies an account submitted and approved are exact matches to status.

- get

  Gets all information relating to a reconciliation report.

  id must be set.

  Populates main hash with values from cr\_report

  Also populates

  - report\_lines

    a list of report lines

  - account\_info

    a hashrefo of information from the account table.

  - beginning\_balance

    - cleared\_total

    - outstanding\_total

    - mismatch\_our\_total

    - mismatch\_our\_credits

    - mismatch\_our\_debits

    - mismatch\_their\_total

    - mismatch\_their\_credits

    - mismatch\_their\_debits

    - get\_accounts

  This is a simple wrapper around reconciliation\_\_account\_list

## Copyright (C) 2007, The LedgerSMB core team.

This file is licensed under the Gnu General Public License version 2, or at your option any later version.  A copy of the license should have been included with your software.
