Skip to content

apslab/poseidon-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins Build Status Travis Build Status

Poseidon::Api

Cliente para interactuar con la API del sistema Poseidon.

Instalación

Agregar la siguiente linea a su Gemfile:

gem 'poseidon-api'

Y luego ejecutar:

$ bundle

O instalar directamente:

$ gem install poseidon-api

Modo de uso

Factura para clientes

api = Poseidon::API(url: 'http://poseidon-url.com', user: '[email protected]', password: '12345')
invoice = Poseidon::Invoice.new(date: Date.today, sale_point: 1, number: 189122)
invoice.client = Poseidon::Client.new(name: 'Los alamos', cuit: 20243234221, iva_condition_id: 1)
invoice.details << Poseidon::Detail.new(amount: 10, unit_price: 15.50, description: 'Carpetas oficio', iva_rate: 21.0)
invoice.details << Poseidon::Detail.new(amount: 4, unit_price: 35.0, description: 'Carpetas plastificada', iva_rate: 21.0)
emitted = api.emit_invoice(invoice)

Retorna un booleano que indica si pudo o no emitir la factura.

En caso de no emitir la factura se pueden verificar los errores utilizando el método 'errors'

Factura de proveedores

api = Poseidon::API(url: 'http://poseidon-url.com', user: '[email protected]', password: '12345')
invoice = Poseidon::Invoice.new(date: Date.today, sale_point: 1, number: 189122)
invoice.supplier = Poseidon::Supplier.new(name: 'Los alamos', cuit: 20243234221, iva_condition_id: 1)
invoice.details << Poseidon::Detail.new(amount: 10, unit_price: 15.50, description: 'Carpetas oficio', iva_rate: 21.0)
invoice.details << Poseidon::Detail.new(amount: 4, unit_price: 35.0, description: 'Carpetas plastificada', iva_rate: 21.0)
emitted = api.emit_invoice(invoice)

Links

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

API para la interacción con el sistema Poseidon

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages