.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "LedgerSMB::AM 3pm" .TH LedgerSMB::AM 3pm "2014-06-10" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" LedgerSMB::AM \- This module provides some administrative functions .SH "SYNOPSIS" .IX Header "SYNOPSIS" This module provides some administrative functions .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 10 \& #==================================================================== \& # LedgerSMB \& # Small Medium Business Accounting software \& # http://www.ledgersmb.org/ \& # \& # Copyright (C) 2006 \& # 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) 2000 \& # \& # Author: DWS Systems Inc. \& # Web: http://www.sql\-ledger.org \& # \& # Contributors: Jim Rawlings \& # \& #==================================================================== \& # \& # This file has undergone whitespace cleanup. \& # \& #==================================================================== \& # \& # Administration module \& # Chart of Accounts \& # template routines \& # preferences \& # \& #==================================================================== .Ve .SH "METHODS" .IX Header "METHODS" .ie n .IP "\s-1AM\-\s0>get_account($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_account($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_account($myconfig, $form);" Populates the \f(CW$form\fR attributes accno, description, charttype, gifi_accno, category, link, and contra with details about the account that has the id \&\f(CW$form\fR\->{id}. If there are no acc_trans entries that refer to that account, \&\f(CW$form\fR\->{orphaned} is made true, otherwise \f(CW$form\fR\->{orphaned} is set to false. .Sp Also populates 'inventory_accno_id', 'income_accno_id', 'expense_accno_id', \&'fxgain_accno_id', and 'fxloss_accno_id' with the values from defaults. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>delete_account($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_account($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_account($myconfig, $form);" Deletes the account with the id \f(CW$form\fR\->{id}. Calls \f(CW$form\fR\->error if there are any acc_trans entries that reference it. If any parts have that account for an inventory, income, or \s-1COGS \s0(expense) account, switch the part to using the default account for that type. Also deletes all tax, partstax, customertax, and vendortax table entries for the account. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>gifi_accounts($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>gifi_accounts($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->gifi_accounts($myconfig, $form);" Populates the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes of gifi numbers and descriptions in order of the \s-1GIFI\s0 number. The \s-1GIFI\s0 number referred to as \&'accno'. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>get_gifi($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_gifi($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_gifi($myconfig, $form);" Sets \f(CW$form\fR\->{description} to the description of the \s-1GIFI\s0 number \f(CW$form\fR\->{accno}. Sets \f(CW$form\fR\->{orphaned} to true if there are no entries in acc_trans that refer to this \s-1GIFI\s0 and to false otherwise. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>save_gifi($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_gifi($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_gifi($myconfig, $form);" Adds or updates a \s-1GIFI\s0 record. If \f(CW$form\fR\->{id} is set, update the gifi record that has that as an account number. The new values for an added or updated record are stored in \f(CW$form\fR\->{accno} and \f(CW$form\fR\->{description}. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>delete_gifi($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_gifi($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_gifi($myconfig, $form);" Deletes the gifi record with the \s-1GIFI\s0 number \f(CW$form\fR\->{id}. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>warehouses($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>warehouses($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->warehouses($myconfig, $form);" Populates the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes describing warehouses, ordered according to the logic of \f(CW$form\fR\->sort_order. Each hash has an id and a description element. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>get_warehouse($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_warehouse($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_warehouse($myconfig, $form);" Sets \f(CW$form\fR\->{description} to the name of the warehouse \f(CW$form\fR\->{id}. If no inventory is currently linked to the warehouse, set \f(CW$form\fR\->{orphaned} to true, otherwise \f(CW$form\fR\->{orphaned} is false. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>save_warehouse($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_warehouse($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_warehouse($myconfig, $form);" Add or update a warehouse. If \f(CW$form\fR\->{id} is set, that warehouse is updated instead of adding a new warehouse. In both cases, the description of the warehouse is set to \f(CW$form\fR\->{description}. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>delete_warehouse($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_warehouse($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_warehouse($myconfig, $form);" Deletes the warehouse with the id \f(CW$form\fR\->{id}. .Sp \&\f(CW$myconfig\fR is not used. .ie n .IP "\s-1AM\-\s0>departments($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>departments($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->departments($myconfig, $form);" Populate the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes of details about departments. The hashes all contain the id, description, and role of the department and are ordered by the description. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>get_department($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_department($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_department($myconfig, $form);" Fills \f(CW$form\fR\->{description} and \f(CW$form\fR\->{role} with details about the department with the id value of \f(CW$form\fR\->{id}. If the department has not been used as part of a transaction referred to in dpt_trans, set \f(CW$form\fR\->{orphaned} to true, otherwise it is set to false. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>save_department($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_department($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_department($myconfig, $form);" Add or update a department record. If \f(CW$form\fR\->{id} is set, the department with that id is updated, otherwise a new department is added. The department role (either 'C' for cost centres or 'P' for profit centres) and description is taken from the \f(CW$form\fR attributes 'role' and 'description'. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>delete_department($myconfig, $form)" 4 .el .IP "\s-1AM\-\s0>delete_department($myconfig, \f(CW$form\fR)" 4 .IX Item "AM->delete_department($myconfig, $form)" Deletes the department with an id of \f(CW$form\fR\->{id}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>business($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>business($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->business($myconfig, $form);" Populates the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes containing details about all known types of business. Each hash contains the id, description, and discount for businesses of this type. The discount is represented in numeric form, such that a 10% discount is stored and retrieved as 0.1. The hashes are sorted by the business description. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>get_business($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_business($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_business($myconfig, $form);" Places the description and discount for the business with an id of \f(CW$form\fR\->{id} into \f(CW$form\fR\->{description} and \f(CW$form\fR\->{discount}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>save_business($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_business($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_business($myconfig, $form);" Adds or updates a type of business. If \f(CW$form\fR\->{id} is set, the business type with a corresponding id is updated, otherwise a new type is added. The new description is \f(CW$form\fR\->{description}. The discount taken as a percentage stored in \f(CW$form\fR\->{discount}, which then value is divided by 100 in place and the multiplier is stored. As an example, if \f(CW$form\fR\->{discount} is 10 when this function is called, it is changed to 0.1 and stored as 0.1. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>delete_business($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_business($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_business($myconfig, $form);" Deletes the business type with the id \f(CW$form\fR\->{id}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>sic($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>sic($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->sic($myconfig, $form);" Populate the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes containing \s-1SIC \s0(some well known systems of which are \s-1NAICS\s0 and \s-1ISIC\s0) data from the sic table. code is the actual \s-1SIC\s0 code, description is a textual description of the code, and sictype is an indicator of whether or not the entry refers to a header. The hashes will be sorted by either the code or description. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>get_sic($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_sic($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_sic($myconfig, $form);" Retrieves the sictype and description for the \s-1SIC\s0 indicated by \&\f(CW$form\fR\->{code} and places the retrieved values into \f(CW$form\fR\->{sictype} and \&\f(CW$form\fR\->{description}. .Sp \&\f(CW$myconfig\fR is unused .ie n .IP "\s-1AM\-\s0>save_sic($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_sic($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_sic($myconfig, $form);" Add or update a \s-1SIC\s0 entry. If \f(CW$form\fR\->{id} is set, take it as the original code to identify the entry update, otherwise treat it as a new entry. \f(CW$form\fR\->{code}, \&\f(CW$form\fR\->{description}, and \f(CW$form\fR\->{sictype} contain the new values. sictype is a single character to flag whether or not the entry is for a header ('H'). .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>delete_sic($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_sic($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_sic($myconfig, $form);" Deletes the \s-1SIC\s0 entry with the code \f(CW$form\fR\->{code}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>language($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>language($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->language($myconfig, $form);" Populates the list referred to as \f(CW$form\fR\->{\s-1ALL\s0} with hashes containing the code and description of all languages entered in the language table. The usual set of \f(CW$form\fR attributes affect the order in which the hashes are entered in the list. .Sp These language functions are unrelated to LedgerSMB::Locale, although these language codes are also used for non-UI templates and by LedgerSMB::PE. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>get_language($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>get_language($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->get_language($myconfig, $form);" Sets \f(CW$form\fR\->{description} to the description of the language that has the code \&\f(CW$form\fR\->{code}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>save_language($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_language($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_language($myconfig, $form);" Add or update a language entry. If \f(CW$form\fR\->{id} is set, the language entry that has that as a code is updated, otherwise a new entry is added. \f(CW$form\fR\->{code} and \f(CW$form\fR\->{description} contain the new values for the entry. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>delete_language($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>delete_language($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->delete_language($myconfig, $form);" Deletes the language entry with the code \f(CW$form\fR\->{code}. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>recurring_transactions($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>recurring_transactions($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->recurring_transactions($myconfig, $form);" Populates lists referred to in the form of \f(CW$form\fR\->{transactions}{$type}, where the possible values for \f(CW$type\fR are 'ar', 'ap', 'gl', 'so', and 'po', with hashes containing details about recurring transactions of the \f(CW$type\fR variety. These hashes have the fields module (the frontend script that governs the transaction type), transaction (the transaction type), invoice (true if the transaction is an invoice), description (a field that is a customer, vendor, or in the case of a \s-1GL\s0 transaction, an arbitrary text field), amount (the cash value of the transaction), id (the id of the recurring transaction), reference (the reference value for the transaction), startdate (the date the recurring sequence started), nextdate (the date of the next occurrence of the event), enddate (the date the sequence ends), repeat (the number of units involved in the recurrence frequency), unit (the base recurrence unit), howmany (how many times the event occurs), payment (whether or not the event involves a payment), recurringemail (a colon separated list of forms to email as part of the event), recurringprint (a colon separated list of forms to print as part of the event), overdue (how many days until the next repetition of the event), vc (vendor, customer, or empty), exchangerate (the exchangerate involved on the day of the original transaction), curr (the currency of the event), and expired (if there will be no more recurrences). .Sp By default, these lists are sorted in order of the date of the next occurrence of the transaction. This order can be affected by the usual attributes used by \f(CW$form\fR\->sort_order. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>recurring_details($myconfig, $form, $id);" 4 .el .IP "\s-1AM\-\s0>recurring_details($myconfig, \f(CW$form\fR, \f(CW$id\fR);" 4 .IX Item "AM->recurring_details($myconfig, $form, $id);" Retrieves details about the recurring transaction \f(CW$id\fR and places them into attributes of \f(CW$form\fR. Sets id (the transaction id passed in, \f(CW$id\fR), reference (a reference string for the recurring transaction), startdate (the date the recurrence series started on), nextdate (the date of the next occurrence of the event), enddate (the date of the final occurrence of the event), repeat (the number of units involved in a recurrence period), unit (the recurrence unit), howmany (the total number of recurrences in the recurrence series), payment (whether or not the transaction is associated with a payment), arid (true if an ar event), apid (true if an ap event), overdue (number of days an ar event was to the duedate), paid (number of days after an ar event it was paid), req (days until the requirement date from the transdate of an oe event), oeid (true if an oe event), customer_id (vendor id if sales order), vendor_id (vendor id if puchase order), vc ('customer' if customer_id set, 'vendor' if vendor_id set), invoice (true if both arid and arinvoice set or if both apid and apinvoice set), recurringemail (colon separated list of forms and formats to be emailed), message (the non-attachement message body for the emails), and recurringprint (colon separated list of form names, formats, and printer names). .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>update_recurring($myconfig, $form, $id)" 4 .el .IP "\s-1AM\-\s0>update_recurring($myconfig, \f(CW$form\fR, \f(CW$id\fR)" 4 .IX Item "AM->update_recurring($myconfig, $form, $id)" Updates nextdate for the recurring transaction \f(CW$id\fR to the next date of the sequence. If the new value for nextdate is after enddate, nextdate is set to \&\s-1NULL.\s0 .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>check_template_name($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>check_template_name($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->check_template_name($myconfig, $form);" Performs some sanity checking on the filename \f(CW$form\fR\->{file} and calls \&\f(CW$form\fR\->error if the filename is disallowed. .ie n .IP "\s-1AM\-\s0>load_template($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>load_template($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->load_template($myconfig, $form);" Populates \f(CW$form\fR\->{body} with the contents of the file \f(CW$form\fR\->{file}. .ie n .IP "\s-1AM\-\s0>save_template($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_template($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_template($myconfig, $form);" Overwrites the file \f(CW$form\fR\->{file} with the contents of \f(CW$form\fR\->{body}, excluding carriage returns. .ie n .IP "\s-1AM\-\s0>save_preferences($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_preferences($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_preferences($myconfig, $form);" Saves the preferences for the current user. New values are taken from the \f(CW$form\fR attributes name, email, dateformat, signature, numberformat, vclimit, tel, fax, company, menuwidth, countrycode, address, timeout, stylesheet, printer, password, new_password, and old_password. Password updates occur when new_password and old_password differ. .ie n .IP "\s-1AM\-\s0>save_defaults($myconfig, $form, \e@defaults);" 4 .el .IP "\s-1AM\-\s0>save_defaults($myconfig, \f(CW$form\fR, \e@defaults);" 4 .IX Item "AM->save_defaults($myconfig, $form, @defaults);" Sets the values in the defaults table to values derived from \f(CW$form\fR. glnumber, sinumber, vinumber, sonumber, ponumber, sqnumber, rfqnumber, partnumber, employeenumber, customernumber, vendornumber, projectnumber, yearend, curr, weightunit, and businessnumber are taken directly from the \f(CW$form\fR value with the corresponding name. .Sp Stores the templates directory for a specific company on defaults table. .Sp \&\f(CW@defaults\fR identifies the list of values to be stored in defaults. If not provided, a default list is used. .ie n .IP "\s-1AM\-\s0>defaultaccounts($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>defaultaccounts($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->defaultaccounts($myconfig, $form);" Retrieves the numbers of default accounts and sets \f(CW$form\fR\->{defaults}{$key} to the appropriate account numbers, where \f(CW$key\fR can be 'inventory_accno_id', \&'income_accno_id', 'income_accno_id', 'expense_accno_id', 'fxgain_accno_id' and 'fxloss_accno_id'. .Sp Sets the hashes refered to as \f(CW$form\fR\->{accno}{${type}_accno_id}{$accno} \- where \f(CW$type\fR one of 'inventory', 'income' and 'expense' \- to contain the id and description of all accounts with \s-1IC\s0 elements in their link fields keyed on the account number. .Sp Fills the hashes referred to as \f(CW$form\fR\->{accno}{fx(gain|loss)_accno_id} with the id and description of all income and expense accounts, keyed on the account number. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>taxes($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>taxes($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->taxes($myconfig, $form);" Retrieve details about all taxes in the database. \f(CW$form\fR\->{taxrates} refers to a list containing hashes with the chart id (id), account number (accno), description, rate, taxnumber, validto, pass, and taxmodulename for a tax. \&\f(CW$form\fR\->{taxmodule_\fBid\fR}, where \fBid\fR is a taxmodule_id, is set to that taxmodule's name. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>save_taxes($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>save_taxes($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->save_taxes($myconfig, $form);" Deletes \fBall\fR entries from the tax table then re-inserts all taxes whose accounts are part of the space separated list \f(CW$form\fR\->{taxaccounts}. Each element of \f(CW$form\fR\->{taxaccounts} is of the form 'chartid_\fIi\fR' where chartid is the id of the chart entry for the tax and \fIi\fR is a numeric index. The values inserted for each tax are chart_id (from taxaccounts), rate ( form\->{taxrate_\fIi\fR} / 100), validto ($form\->{validto_\fIi\fR}), taxnumber ($form\->{taxnumber_\fIi\fR}), pass ($form\->{pass_\fIi\fR}), and taxmodule_id ($form\->{taxmodule_id_\fIi\fR}). .ie n .IP "\s-1AM\-\s0>closedto($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>closedto($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->closedto($myconfig, $form);" Populates \f(CW$form\fR\->{closedto}, \f(CW$form\fR\->{revtrans}, and \f(CW$form\fR\->{audittrail} with their values in the defaults table. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>closebooks($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>closebooks($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->closebooks($myconfig, $form);" Updates the revtrans, closedto, and audittrail entries in the defaults table using their corresponding \f(CW$form\fR values. If \f(CW$form\fR\->{removeaudittrail} is set, this used to remove all audittrail entries with a transdate prior to the date given by \f(CW$form\fR\->{removeaudittrail}, but has been disabled. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>earningsaccounts($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>earningsaccounts($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->earningsaccounts($myconfig, $form);" Populates the list referred to as \f(CW$form\fR\->{chart} with hashes containing the account number (accno) and the description of all equity accounts, ordered by the account number. .Sp \&\f(CW$myconfig\fR is unused. .ie n .IP "\s-1AM\-\s0>post_yearend($myconfig, $form);" 4 .el .IP "\s-1AM\-\s0>post_yearend($myconfig, \f(CW$form\fR);" 4 .IX Item "AM->post_yearend($myconfig, $form);" Posts the termination of a financial year. Makes use of the \f(CW$form\fR attributes login, reference, notes, description, and transdate to populate the gl table entry. The id of the gl transaction is placed in \f(CW$form\fR\->{id}. .Sp For every accno_$i in \f(CW$form\fR, where \f(CW$i\fR is between 1 and \f(CW$form\fR\->{rowcount}, an acc_trans entry will be added if credit_$i or debit_$i is non-zero. .Sp A new yearend entry is populated with the id and transdate of the gl transaction. .Sp Adds an entry to the audittrail. .Sp \&\f(CW$myconfig\fR is unused. .IP "\s-1AM\-\s0>get_all_defaults($form);" 4 .IX Item "AM->get_all_defaults($form);" Retrieves all settings from defaults and sets the appropriate \f(CW$form\fR values. Also runs \s-1AM\-\s0>defaultaccounts. .IP "\s-1AM\-\s0>get_templates_directories;" 4 .IX Item "AM->get_templates_directories;" This functions gets all the directories from \f(CW$LedgerSMB::Sysconfig::templates\fR to list all the possible non-Ui templates.