Sha256: 013cc02560fe63a89a199ef6978e557d35e8fa3153e619759a38855acc89551a

Contents?: true

Size: 1.39 KB

Versions: 8

Compression:

Stored size: 1.39 KB

Contents

#!/usr/bin/env ruby
# Config -- pdfinvoice -- 28.07.2005 -- hwyss@ywesee.com

require 'rclconf'

module PdfInvoice
	def PdfInvoice.config(argv=[])
		default_dir = File.join(Dir.home, '.pdfinvoice')
		default_config_files = [
			File.join(default_dir, 'config.yml'),
			'/etc/pdfinvoice/config.yml',
		]
		defaults = {
			'colors'						=> {
				'items'						=> [0xFA, 0xFA, 0xFA],	
				'total'						=> [0xF0, 0xF0, 0xF0],	
			},
			'config'						=> default_config_files,
			'creditor_address'	=> "Please set creditor_address etc in: #{default_config_files}",
			'creditor_email'		=> '',
			'creditor_bank'			=> '',
			'due_days'					=> '',
			'font'							=> 'Helvetica',
			'font_b'						=> 'Helvetica-Bold',
			'formats'						=> {
				'currency'				=> "%1.2f",
				'total'						=> "%1.2f",
				'date'						=> "%d.%m.%Y",
				'invoice_number'	=> "<b>#%06i</b>",
				'quantity'				=> '%1.1f',
			},
			'logo_path'					=> nil,
			'logo_link'					=> nil,
			'texts'							=> {
				'date'						=> 'Date',	
				'description'			=> 'Description',
				'unit'						=> 'Unit',
				'quantity'				=> 'Quantity',
				'price'						=> 'Price',
				'item_total'			=> 'Item Total',
				'subtotal'				=> 'Subtotal',
				'tax'							=> 'Tax',
				'thanks'					=> nil,
				'total'						=> 'Total',
			},
			'text_options'			=> {:spacing => 1.25},
		}
		config = RCLConf::RCLConf.new(ARGV, defaults)
		config.load(config.config)
		config
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ydim-1.1.5 lib/pdfinvoice/config.rb
ydim-1.1.4 lib/pdfinvoice/config.rb
ydim-1.1.3 lib/pdfinvoice/config.rb
ydim-1.1.2 lib/pdfinvoice/config.rb
ydim-1.1.1 lib/pdfinvoice/config.rb
ydim-1.1.0 lib/pdfinvoice/config.rb
ydim-1.0.9 lib/pdfinvoice/config.rb
ydim-1.0.8 lib/pdfinvoice/config.rb