invoice: Create an invoice object

Description Usage Arguments Value Examples

Description

Create an invoice object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
invoice(month = NULL, year = lubridate::year(lubridate::today()),
  since = if (is.null(month)) {     d <- lubridate::today() - months(1)  
    lubridate::day(d) <- 1     d } else
  lubridate::ymd(sprintf("%s-%s-01", year, month)), until = since +
  months(1) - lubridate::days(1),
  client = getOption("invoicer_default_client", "without client"),
  date = until + lubridate::days(1),
  address = getOption("invoicer_default_address", ""), expenses = 0,
  template_key = getOption("invoicer_template_key",
  stop("template key must be specified")), inv_num = 1)

Arguments

month

specify month for a one-month invoice

year

invoice year

since

if month is not specified, beginning of invoice period

until

end of invoice period

client

client name

date

invoice date, defaults to the day after until

address

client address

expenses

amount of expenses for current month

template_key

the google drive key for the template to use. must be in your google drive

inv_number

invoice number/code

Value

an invoice object, a tibble with the following attributes:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# create an invoice for the latest complete calendar month using the default
# client, address, and template
invoice()

# create an invoice for this month to date
invoice(
  since = lubridate::floor_date(today(),"month"),
  until = lubridate::today()
)

## End(Not run)

mlgrm/invoicer documentation built on May 20, 2019, 11:59 a.m.