App-GnuCash-MembershipUtils

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

name: App-GnuCash-MembershipUtils
no_index: {}
requires:
  Carp: '0'
  Cwd: '0'
  DBD::SQLite: '0'
  DBIx::Class::Core: '0'
  DBIx::Class::ResultSet: '0'
  DBIx::Class::Schema: '0'
  Data::Dump: '0'
  DateTime: '0'
  DateTime::Format::DateParse: '0'
  Exporter: '0'
  File::Basename: '0'
  File::Slurp: '0'
  File::Spec: '0'
  Getopt::Long: '0'
  Pod::Usage: '0'
  Readonly: '0'
  Text::CSV: '0'
  YAML::XS: '0'
  base: '0'

Makefile.PL  view on Meta::CPAN

  "MIN_PERL_VERSION" => "5.010000",
  "NAME" => "App::GnuCash::MembershipUtils",
  "PREREQ_PM" => {
    "Carp" => 0,
    "Cwd" => 0,
    "DBD::SQLite" => 0,
    "DBIx::Class::Core" => 0,
    "DBIx::Class::ResultSet" => 0,
    "DBIx::Class::Schema" => 0,
    "Data::Dump" => 0,
    "DateTime" => 0,
    "DateTime::Format::DateParse" => 0,
    "Exporter" => 0,
    "File::Basename" => 0,
    "File::Slurp" => 0,
    "File::Spec" => 0,
    "Getopt::Long" => 0,
    "Pod::Usage" => 0,
    "Readonly" => 0,
    "Text::CSV" => 0,
    "YAML::XS" => 0,
    "base" => 0,

Makefile.PL  view on Meta::CPAN



my %FallbackPrereqs = (
  "Carp" => 0,
  "Cwd" => 0,
  "DBD::SQLite" => 0,
  "DBIx::Class::Core" => 0,
  "DBIx::Class::ResultSet" => 0,
  "DBIx::Class::Schema" => 0,
  "Data::Dump" => 0,
  "DateTime" => 0,
  "DateTime::Format::DateParse" => 0,
  "Exporter" => 0,
  "File::Basename" => 0,
  "File::Slurp" => 0,
  "File::Spec" => 0,
  "Getopt::Long" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Pod::Usage" => 0,
  "Readonly" => 0,
  "Test::More" => 0,

bin/gc-members-generate-invoices  view on Meta::CPAN

  File::Spec->splitdir(dirname(__FILE__)), 
  qq{..}, 
  qq{lib});
use App::GnuCash::MembershipUtils qw( :all );
use Getopt::Long qw( :config no_ignore_case bundling );
use Pod::Usage;
use Cwd qw(abs_path);
use Readonly;
use Data::Dump qw( pp );
use Text::CSV;
use DateTime;
use DateTime::Format::DateParse;

Readonly::Hash my %DATE_FORMATS => (
    us     => "%m/%d/%Y",   # MM/DD/YYYY
    uk     => "%d/%m/%Y",   # DD/MM/YYYY
    iso    => "%Y-%m-%d",   # YYYY-MM-DD
    europe => "%d.%m.%Y",   # DD.MM.YYYY
);

## Used for the version string
Readonly::Scalar my $VERSION       => qq{0.01};

bin/gc-members-generate-invoices  view on Meta::CPAN


##----------------------------------------------------------------------------
## MAIN
##----------------------------------------------------------------------------
## Set STDOUT to autoflush
$| = 1;    ## no critic (RequireLocalizedPunctuationVars)

## Parse the command line
process_commandline();

my $dt_tz = DateTime::TimeZone->new( name => 'local' );
my $inv_open_dt;
if ($gOptions{open}) {
    $inv_open_dt = DateTime::Format::DateParse->parse_datetime($gOptions{open});
} else {
    # Default is first of the current month
    $inv_open_dt = DateTime->today( time_zone => $dt_tz, )->set_day(1);
}

my $inv_due_dt;
if ($gOptions{due}) {
    $inv_due_dt = DateTime::Format::DateParse->parse_datetime($gOptions{due});
} else {
    # Default is last of current month.
    # This is done by getting the 1st day of next month and subtrating 1 day
    $inv_due_dt = DateTime->today( time_zone => $dt_tz, )->set_day(1)->add(months => 1)->subtract(days => 1);
}

if ($inv_open_dt > $inv_due_dt) {
  printf STDERR "ERROR: The opening date cannot be after the due date!\n";
  exit(1);
}

my ($error, $config) = get_config($gOptions{config}, $gOptions{debug});

if ($error) {

bin/gc-members-generate-invoices  view on Meta::CPAN

        $gOptions{format},
        join("', '", keys(%DATE_FORMATS));
    exit(1);
}

$gOptions{memo} //= $config->{GnuCash}{memo};

$gOptions{note} //= $inv_open_dt->strftime("%B membership dues");

unless ($gOptions{outfile}) {
    $gOptions{outfile} = DateTime->today( time_zone => $dt_tz, )->strftime("%Y-%m-%d_gnucash_customer_invoices.csv");
}

my $schema;
($error, $schema) = open_gnucash(get_gnucash_filename($gOptions{file}, $config));
if ($error) {
  printf STDERR "Error opening GnuCash file: %s\n", $error;
  exit(1);
}

my $warning;

cpanfile  view on Meta::CPAN

# This file is generated by Dist::Zilla::Plugin::CPANFile v6.031
# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.

requires "Carp" => "0";
requires "Cwd" => "0";
requires "DBD::SQLite" => "0";
requires "DBIx::Class::Core" => "0";
requires "DBIx::Class::ResultSet" => "0";
requires "DBIx::Class::Schema" => "0";
requires "Data::Dump" => "0";
requires "DateTime" => "0";
requires "DateTime::Format::DateParse" => "0";
requires "Exporter" => "0";
requires "File::Basename" => "0";
requires "File::Slurp" => "0";
requires "File::Spec" => "0";
requires "Getopt::Long" => "0";
requires "Pod::Usage" => "0";
requires "Readonly" => "0";
requires "Text::CSV" => "0";
requires "YAML::XS" => "0";
requires "base" => "0";

lib/GnuCash/Schema.pm  view on Meta::CPAN


    my $schema = GnuCash::Schema->connect("dbi:SQLite:/path/to/file.gnucash");

    my $account = $schema->resultset->('Account')->search()->first();

=head1 DESCRIPTION

This module and all the GnuCash::Schema::Result modules were auto generated
by running the following: 

    dbicdump -o dump_directory=./lib -o components='["InflateColumn::DateTime"]' GnuCash::Schema dbi::SQLite:/path/to/sample.gnucash

=cut

1;

lib/GnuCash/Schema/Result/Account.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<accounts>

=cut

__PACKAGE__->table("accounts");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Billterm.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<billterms>

=cut

__PACKAGE__->table("billterms");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Book.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<books>

=cut

__PACKAGE__->table("books");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Budget.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<budgets>

=cut

__PACKAGE__->table("budgets");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/BudgetAmount.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<budget_amounts>

=cut

__PACKAGE__->table("budget_amounts");

=head1 ACCESSORS

=head2 id

lib/GnuCash/Schema/Result/Commodity.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<commodities>

=cut

__PACKAGE__->table("commodities");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Customer.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<customers>

=cut

__PACKAGE__->table("customers");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Employee.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<employees>

=cut

__PACKAGE__->table("employees");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Entry.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<entries>

=cut

__PACKAGE__->table("entries");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Gnclock.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<gnclock>

=cut

__PACKAGE__->table("gnclock");

=head1 ACCESSORS

=head2 hostname

lib/GnuCash/Schema/Result/Invoice.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<invoices>

=cut

__PACKAGE__->table("invoices");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Job.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<jobs>

=cut

__PACKAGE__->table("jobs");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Lot.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<lots>

=cut

__PACKAGE__->table("lots");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Order.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<orders>

=cut

__PACKAGE__->table("orders");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Price.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<prices>

=cut

__PACKAGE__->table("prices");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Recurrence.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<recurrences>

=cut

__PACKAGE__->table("recurrences");

=head1 ACCESSORS

=head2 id

lib/GnuCash/Schema/Result/Schedxaction.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<schedxactions>

=cut

__PACKAGE__->table("schedxactions");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Slot.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<slots>

=cut

__PACKAGE__->table("slots");

=head1 ACCESSORS

=head2 id

lib/GnuCash/Schema/Result/Split.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<splits>

=cut

__PACKAGE__->table("splits");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Taxtable.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<taxtables>

=cut

__PACKAGE__->table("taxtables");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/TaxtableEntry.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<taxtable_entries>

=cut

__PACKAGE__->table("taxtable_entries");

=head1 ACCESSORS

=head2 id

lib/GnuCash/Schema/Result/Transaction.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<transactions>

=cut

__PACKAGE__->table("transactions");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Vendor.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<vendors>

=cut

__PACKAGE__->table("vendors");

=head1 ACCESSORS

=head2 guid

lib/GnuCash/Schema/Result/Version.pm  view on Meta::CPAN


use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<versions>

=cut

__PACKAGE__->table("versions");

=head1 ACCESSORS

=head2 table_name



( run in 0.517 second using v1.01-cache-2.11-cpan-05444aca049 )