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

# LedgerSMB::AA(3pm)

Contains the routines for managing AR and AP transactions.

## NAME

LedgerSMB::AA - Contains the routines for managing AR and AP transactions.

## SYNOPSIS

This module contains the routines for managing AR and AP transactions and  many of the reorts (a few others are found in LedgerSMB::RP.pm).

All routines require `$form`-\>{dbh} to be set so that database actions can be performed.

This module is due to be deprecated for active development as soon as a  replacement is available.

- *post\_transaction()* Post transaction uses the following variables in the $form variable: \* dbh - the database connection handle \* currency - The current users' currency \* defaultcurrency - The "normal" currency \* department - Unknown \* department\_id - ID for the department \* exchangerate - Conversion between currency and defaultcurrency \* invnumber - invoice number \* reverse - ? \* rowcount - Number of rows in the invoice \* taxaccounts - Apply taxes? \* taxincluded - ? \* transdate - Date of the transaction \* vc - Vendor or customer - determines transaction type

  - get\_files

  Returns a list of files associated with the existing transaction.  This is  provisional, and will change for 1.4 as the GL transaction functionality is \
                     {ref\_key =\> `$self`-\>{id}, file\_class =\> 1} rewritten

- delete\_transaction(\\%myconfig, $form)

  Deletes a transaction identified by `$form`-\>{id}, whether it is an ar or ap transaction is identified by `$form`-\>{vc}.  `$form`-\>{invnumber} used for the  audittrail routine.

- transactions(\\%myconfig, $form)

  Generates the transaction and outstanding reports.  Form variables used in this function are:

  approved: whether or not transactions must be approved to show up

  transdatefrom: Earliest day of transactions

  transdateto:  Latest day of transactions

  month, year, interval:  Used in palce of transdatefrom and transdate to

  vc:  'customer' for ar, 'vendor' for ap.

  meta\_number:  customer/vendor number

  entity\_id:  A specific entity id

  parts\_id:  Show transactions including a specific part

  department\_id:  Transactions for a department

  entity\_credit\_account: As an alternate for meta\_number to identify a customer of vendor credit account

  invoice\_type:  3 for on-hold, 2 for active

  The transaction list is stored at: @{$form-\>{transactions}}

- get\_name(\\%myconfig, $form)

  Retrieves the last account used.  Also retrieves tax accounts, departments, and a few other things.

  Form variables used: vc: customer or vendor ${vc}\_id:  id of vendor/customemr transdate:  Transaction date desired

  Sets the following form variables currency exchangerate forex taxaccounts

- taxform\_exist($form, $cv\_id)

  Determines if a taxform attached to the entity\_credit\_account record (where the id field is the same as `$cv_id`) exists. Returns true if it exists, false if not.

- update\_ac\_tax\_form($form,$dbh,$entry\_id,$report)

  Updates the ac\_tax\_form checkbox for the acc\_trans.entry\_id (where it is the  same as `$entry_id`).  If `$report` is true, sets it to true, if false, sets it to false.  `$report` must be a valid \*postgresql\* bool value (0/1, t/f,  'true'/'false').

- get\_taxchech($entry\_id,$dbh)

  Returns true if the acc\_trans record has been set to reportable in the past false otherwise.

- save\_intnotes($form)

  Saves the `$form`-\>{intnotes} into the ar/ap.intnotes field.

## COPTYRIGHT

\# LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # Copyright (C) 2006-2010 # This work contains copyrighted information from a number of sources all used # with permission. # # This file contains source code included with or based on SQL-Ledger which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed # under the GNU General Public License version 2 or, at your option, any later # version.  For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2006 # #  Author: DWS Systems Inc. #     Web: http://www.sql-ledger.org # #  Contributors: # # # See COPYRIGHT file for copyright information
