AccountInvoice.rb

Path: lib/Helpers/AccountInvoice.rb
Last Update: Fri Mar 05 15:15:22 +0100 2010

OERPScenario, OpenERP Functional Tests Author Nicolas Bessi & Joel Grand-Guillaume 2009 Copyright Camptocamp SA

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 Afero of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Required files

rubygems   ooor   pp  

Methods

Public Class methods

Create an invoice with given informations Add a line if amount <> false, the account could be provided or not Input :

 - name : Name of the invoice
 - partner : A valid ResPartner instance
 - option {
   currency_code (Default : EUR) : An ISO code for currency
   date (Default : false) : A date in this text format : 1 jan 2009
   amount (Default : false) : An amount for the invoice => this will create a line
   account (Default : false) : An valide AccountAccount
   type (Default : out_invoice) : the invoice type
 }

Return

 - The created AccountInvoice as a instance of the class¨

Usage Example: part = ResPartner.find(:first) puts part.id inv = AccountInvoice.create_cust_invoice_with_currency(‘my name’,part,{currency_code =>’CHF’})

[Validate]