Gavin Henry
and 2 contributors

NAME

Net::KashFlow

VERSION

version 0.04

SYNOPSIS

    my $kf = Net::KashFlow->new(username => $u, password => $p);

    my $c = $kf->get_customer($cust_email);
    my $i = $kf->create_invoice({
        InvoiceNumber => time, CustomerID => $c->CustomerID
    });

    $i->add_line({ Quantity => 1, Description => "Widgets", Rate => 100 })

    $i->pay({ PayAmount => 100 });

NAME

Net::KashFlow - Interact with KashFlow accounting web service

WARNING

This module is incomplete. It does not implement all of the KashFlow API. Please find the github repository at http://github.com/simoncozens/Net-KashFlow and send me pull requests for your newly-implemented features. Thank you.

METHODS

new

Simple constructor - requires "username" and "password" named parameters.

get_supplier($id)

Returns a Net::KashFlow::Supplier object for the supplier

get_supplier_by_id($id)

Returns the Net::KashFlow::Supplier object as specified by the ID

get_customer($id | $email)

Returns a Net::KashFlow::Customer object for the given customer. If the parameter passed has an @ sign then this is treated as an email address and the customer looked up email address; otherwise the customer is looked up by customer code. If no customer is found in the database, nothing is returned.

get_customer_by_id($internal_id)

Like get_customer, but works on the internal ID of the customer.

get_customers

Returns all customers

create_customer({ Name => "...", Address => "...", ... });

Inserts a new customer into the database, returning a Net::KashFlow::Customer object.

get_invoice($your_id)

get_invoice_by_id($internal_id)

Returns a Net::KashFlow::Invoice object representing the invoice.

get_invoice_pdf($id)

Returns the URI for a PDF of the specified invoice

get_invoice_paypal_link($id)

Returns a Paypal payment link for the specified invoice ID.

get_overdue_invoices

Returns an array of overdue invoices. Each element is a Net::KashFlow::Invoice object

get_unpaid_invoices

Returns an array of unpaid invoices. Each element is a Net::KashFlow::Invoice object

get_invoices_for_customer($customerID)

Returns an array containing all of the invoices for the specified customer

create_invoice({ ... })

delete_invoice($invoice_id)

Delete an invoice. Returns true if invoice deleted

get_receipt($id)

Returns a Net::KashFlow::Receipt object representing the receipt

get_receipt_by_id($id)

Returns a Net::KashFlow::Receipt object representing the receipt but by ID

get_receipts_for_supplier($id)

Returns an array containing all receipts for the specified supplier.

create_receipt ({ ... })

Create a new receipt. For details, see

http://accountingapi.com/manual_methods_InsertReceipt.asp

Returns a Net::KashFlow::Receipt object

get_invoice_payment()

Returns a Net::KashFlow::Payment object for an invoice payment.

    $kf->get_invoice_payment({
        InvoiceNumber => $id
    });

Returns a Net::KashFlow::Payment object for an invoice payment.

delete_invoice_payment

    $kf->delete_invoice_payment({
        InvoicePaymentNumber => 12345
    })

Deletes a specific invoice payment

Returns 1 if payment deleted

get_vat_rates();

Returns a list of VAT rates

Net::KashFlow::Customer

    my $c = $kf->get_customer($email);

    $c->Telephone("+44.500123456");
    $c->update;

    print $c->Address1(), $c->Address2();

Customer objects have accessors as specified by http://accountingapi.com/manual_class_customer.asp - these accessors are not "live" in that changes to them are only sent to KashFlow on call to the update method.

This package also has a delete method to remove the customer from the database, and an invoices method which returns all the Net::KashFlow::Invoice objects assigned to this customer.

Net::KashFlow::Invoice

    my @i = $kf->get_customer($email)->invoices;
    for (@i) { $i->Paid(1); $i->update }

Similarly to Customer, fields found at http://accountingapi.com/manual_class_invoice.asp

Also:

    $i->add_line({ Quantity => 1, Description => "Widgets", Rate => 100 });
    $i->pay({ PayAmount => 100 });

Net::KashFlow::Receipt

    my @i = $kf->get_customer($email)->receipts;
    for (@i) { $i->Paid(1); $i->update }

Just like Net::KashFlow::Invoice but for receipts. Fields at http://accountingapi.com/manual_class_invoice.asp

Also:

    $i->add_line({ Quantity => 1, Description => "Widgets", Rate => 100 });
    $i->pay({ PayAmount => 100 });

Net::KashFlow::Payment

Payment object. Fields: http://accountingapi.com/manual_class_payment.asp

AUTHOR

Simon Cozens, <simon at simon-cozens.org>

BUGS

Please report any bugs or feature requests to bug-net-kashflow at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-KashFlow. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

I am aware that this module is WOEFULLY INCOMPLETE and I'm looking forward to receiving patches to add new functionality to it. Currently it does what I want and I don't have much incentive to finish it. :/

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Net::KashFlow

You can also look for information at:

ACKNOWLEDGEMENTS

Thanks to the UK Free Software Network (http://www.ukfsn.org/) for their support of this module's development. For free-software-friendly hosting and other Internet services, try UKFSN.

COPYRIGHT & LICENSE

Copyright 2009 Simon Cozens.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

AUTHORS

  • 'Simon Cozens <simon at simon-cozens.org>'

  • 'Jason Clifford <jason@ukfsn.org>'

  • 'Gavin Henry <ghenry@surevoip.co.uk>'

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Gavin Henry, Simon Cozens, Jason Clifford.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.