App::GnuCash::MembershipUtils - A group of perl modules and scripts to help in using GnuCash for membership.
App::GnuCash::MembershipUtils is a group of perl modules and scripts to help in using GnuCash for membership.
It assumes all customers are members, and uses the customer "notes" field to determine what type of membership for each member / customer.
Version 0.01
use App::GnuCash::MembershipUtils qw( :all );
my ($error, $config) = get_config($filename);
Returns an $error if the given $filename cannot be opened. If there is no $error then $config will be a HASHREF with the config.
$error
$filename
$config
my $filename = get_filename_from_config($override, $config);
Returns the GnuCash.file from the given $config.
GnuCash.file
my ($error, $schema) = open_gnucash($filename);
Returns an $error if the given $filename cannot be opened. If $error is undef, then $schema will be a GnuCash::Schema object.
$schema
GnuCash::Schema
my @members = get_all_members($args);
Accepts a HASHREF of $args whose keys are as follows:
$args
Returns an ARRAY of HASHREFs whose keys are as follows:
my $title = title_case($string);
Converts the given $string by returning a string by converting the snake case into title case.
$string
my $max = max_length(@array);
Returns the maximum length of the strings in the arguments provided.
my $accounts = db_accounts_to_hash($schema);
Returns a HASHREF whose keys are the complete name of each account, and whose keys are as follows:
my ($errors, $warnings) = validate_accounts_in_config($args); warn $warnings if ($warnings); die $errors if ($errors);
Returns $errors which is a string indicating fatal errors, and $warnings which is a non-fatal error.
$errors
$warnings
This module supports reading a YAML based config file.
Here is a sample config file:
--- GnuCash: file: /path/to/organization.gnucash format: US memo: Monthly membership dues account: Assets:Accounts Receivable MembershipTypes: default: name: Standard Membership account: Income:Membership Dues amount: 30.00 others: - name: Special Membership match: Special account: Income:Membership Dues amount: 50.00 - name: Company Membership match: Company account: Income:Membership Dues amount: 80.00
This section contains parameters related to the GnuCash file.
Recognized keys are:
The full path to the GnuCash file.
The date format to use when generating CSV files for import into GnuCash.
NOTE: This must match the date format selcted in the GnuCash preferences.
Must be one of:
MM/DD/YYYY
DD/MM/YYYY
DD.MM.YYYY
YYYY-MM-DD
DEFAULT: US
US
Optional description or memo used for the item on each invoice.
DEFAULT: Membership dues
Membership dues
The GnuCash account used for posting the invoices, this is typically Assets:Accounts Receivable.
Assets:Accounts Receivable
This is a required section that configures how a membership type is determined, and the details such as account and amount used for generating invoices.
account
amount
This section recognizes the following sub sections:
This required subsection provides details for the default membership type to apply when no others match.
This optional subsection provides a list of sections that describe different types of memberships.
Each of these subsections supports the following keys:
The name of the membership type.
The GnuCash account to use when generating invoices for this type of account.
The amount to use when generating invoices for this type of account.
Used when examining the customer's notes to determine what type of membership for the customer.
notes
NOTE: The default does not include a match because it is used when none of the others match.
default
match
others
To install App::GnuCash::MembershipUtils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::GnuCash::MembershipUtils
CPAN shell
perl -MCPAN -e shell install App::GnuCash::MembershipUtils
For more information on module installation, please visit the detailed CPAN module installation guide.