![]() |
![]()
| ![]() |
![]()
NAMENet::FreshBooks::API::Estimate - FreshBooks Estimate access VERSIONversion 0.24 SYNOPSISEstimate objects are created via Net::FreshBooks::API my $fb = Net::FreshBooks::API->new( {...} ); my $estimate = $fb->estimate->create({ client_id => $id }); # add as many items as you need $estimate->add_line( { name => "Estimate Test line 1", unit_cost => 1, quantity => 1, } ), "Add a line to the estimate"; ok $estimate->add_line( { name => "Estimate Test line 2", unit_cost => 2, quantity => 2, } ), "Add second line to the estimate"; print $estimate->status; # draft # in order to make the URL viewable, you'll need to mark it as "sent" $estimate->status( 'sent' ); $estimate->update; # viewable URL is: print $estimate->links->client_view; createCreate an estimate in the FreshBooks system. my $estimate = $fb->estimate->create({...}); deletemy $estimate = $fb->estimate->get({ estimate_id => $estimate_id }); $estimate->delete; getmy $estimate = $fb->estimate->get({ estimate_id => $estimate_id }); update$estimate->organization('Perl Foundation'); $estimate->update; # or more quickly $estimate->update( { organization => 'Perl Foundation', } ); add_lineCreate a new Net::FreshBooks::API::InvoiceLine object and add it to the end of the list of lines my $bool = $estimate->add_line( { name => "Yard Work", # (Optional) description => "Mowed the lawn.", # (Optional) unit_cost => 10, # Default is 0 quantity => 4, # Default is 0 tax1_name => "GST", # (Optional) tax2_name => "PST", # (Optional) tax1_percent => 8, # (Optional) tax2_percent => 6, # (Optional) } ); linksReturns a Net::FreshBooks::API::Links object, which returns FreshBooks URLs. print "send this url to client: " . $estimate->links->client_view; listReturns a Net::FreshBooks::API::Iterator object. # list unpaid estimates my $estimates = $fb->estimate->list({ status => 'unpaid' }); while ( my $estimate = $estimates->next ) { print $estimate->estimate_id, "\n"; } linesReturns an ARRAYREF of Net::FreshBooks::API::InvoiceLine objects foreach my $line ( @{ $estimate->lines } ) { print $line->amount, "\n"; } send_by_emailSend the estimate by email. my $result = $estimate->send_by_email(); DESCRIPTIONThis class gives you access to FreshBooks invoice information. Net::FreshBooks::API will construct this object for you. AUTHORS
COPYRIGHT AND LICENSEThis software is copyright (c) 2011 by Edmund von der Burg & Olaf Alders. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|