~kdsch/invoicer

e9f14eeafb96ada22257ceff9486c82f05d6653d — Karl Schultheisz 4 years ago 5db9934
gofmt
2 files changed, 8 insertions(+), 10 deletions(-)

M db.go
M report.go
M db.go => db.go +6 -7
@@ 33,13 33,13 @@ type inserter interface {
}

func insert(addr string, i inserter) error {
		db, err := sql.Open("sqlite3", addr)
		if err != nil {
			return fmt.Errorf("sql.Open: %v", err)
		}
		defer db.Close()
	db, err := sql.Open("sqlite3", addr)
	if err != nil {
		return fmt.Errorf("sql.Open: %v", err)
	}
	defer db.Close()

		return i.insert(db)
	return i.insert(db)
}

func findPartyIDByCode(code string, db *sql.DB) (id uuid.UUID, err error) {


@@ 139,4 139,3 @@ func (i item) insert(invoice uuid.UUID, db *sql.DB) error {
	)
	return err
}


M report.go => report.go +2 -3
@@ 1,10 1,10 @@
package main

import (
	"io"
	"database/sql"
	"fmt"
	"html/template"
	"io"
	"os"
	"strings"
	"time"


@@ 54,7 54,7 @@ func (r *report) loadInvoice(invoice uuid.UUID, db *sql.DB) error {
		&customer,
		&seller,
		&r.Summary,
	);
	)
	if err != nil {
		return fmt.Errorf("error selecting invoice %q: %v", invoice, err)
	}


@@ 145,4 145,3 @@ func (r report) Total() float64 {
func (i item) Total() float64 {
	return i.Rate * i.Hours
}