code dump

master
q3k 2019-03-11 20:28:59 +01:00
parent 6269824571
commit ecac445dfb
6 changed files with 226 additions and 433 deletions

View File

@ -22,8 +22,10 @@ message Invoice {
repeated ContactPoint invoicer_contact = 3;
repeated string customer_billing = 4;
string invoicer_vat_id = 5;
string invoicer_company_number = 12;
string customer_vat_id = 6;
bool reverse_vat = 7;
bool us_customer = 11;
int64 days_due = 8;
string iban = 9;
string swift = 10;

View File

@ -11,13 +11,13 @@ import (
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/status"
"code.hackerspace.pl/q3k/hspki"
pb "code.hackerspace.pl/q3k/inboice/proto"
)
var (
flagListenAddress string
flagInit bool
flagDisablePKI bool
)
type service struct {
@ -145,6 +145,7 @@ func (s *service) RenderInvoice(req *pb.RenderInvoiceRequest, srv pb.Inboice_Ren
return status.Error(codes.Unavailable, "internal server error")
}
glog.Infof("%+v", invoice)
rendered, err = renderInvoicePDF(invoice, "xxxx", true)
if err != nil {
glog.Errorf("renderProformaPDF(_): %v", err)
@ -203,7 +204,7 @@ func main() {
glog.Exitf("net.Listen(tcp, %q): %v", flagListenAddress, err)
}
grpcSrv := grpc.NewServer(hspki.WithServerHSPKI()...)
grpcSrv := grpc.NewServer()
pb.RegisterInboiceServer(grpcSrv, s)
reflection.Register(grpcSrv)

View File

@ -72,7 +72,7 @@ func (m *model) sealInvoice(ctx context.Context, uid string) error {
invoice_id, final_uid
) values (
?,
( select printf("%04d", ifnull( (select final_uid as v from invoice_seal order by final_uid desc limit 1), 7) + 1 ))
( select printf("%04d", ifnull( (select final_uid as v from invoice_seal order by final_uid desc limit 1), 19000) + 1 ))
)
`

View File

@ -1,18 +1,38 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: inboice.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
inboice.proto
It has these top-level messages:
Item
ContactPoint
Invoice
CreateInvoiceRequest
CreateInvoiceResponse
GetInvoiceRequest
GetInvoiceResponse
RenderInvoiceRequest
RenderInvoiceResponse
SealInvoiceRequest
SealInvoiceResponse
*/
package proto
import proto1 "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = proto1.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@ -20,7 +40,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
type GetInvoiceResponse_State int32
@ -35,7 +55,6 @@ var GetInvoiceResponse_State_name = map[int32]string{
1: "STATE_PROFORMA",
2: "STATE_SEALED",
}
var GetInvoiceResponse_State_value = map[string]int32{
"STATE_INVALID": 0,
"STATE_PROFORMA": 1,
@ -43,49 +62,23 @@ var GetInvoiceResponse_State_value = map[string]int32{
}
func (x GetInvoiceResponse_State) String() string {
return proto.EnumName(GetInvoiceResponse_State_name, int32(x))
}
func (GetInvoiceResponse_State) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{6, 0}
return proto1.EnumName(GetInvoiceResponse_State_name, int32(x))
}
func (GetInvoiceResponse_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{6, 0} }
type Item struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
UnitPrice uint64 `protobuf:"varint,3,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"`
Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"`
Count uint64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"`
UnitPrice uint64 `protobuf:"varint,3,opt,name=unit_price,json=unitPrice" json:"unit_price,omitempty"`
// in thousands of percent points
// (ie 23% == 23000)
Vat uint64 `protobuf:"varint,4,opt,name=vat,proto3" json:"vat,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Vat uint64 `protobuf:"varint,4,opt,name=vat" json:"vat,omitempty"`
}
func (m *Item) Reset() { *m = Item{} }
func (m *Item) String() string { return proto.CompactTextString(m) }
func (*Item) ProtoMessage() {}
func (*Item) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{0}
}
func (m *Item) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Item.Unmarshal(m, b)
}
func (m *Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Item.Marshal(b, m, deterministic)
}
func (m *Item) XXX_Merge(src proto.Message) {
xxx_messageInfo_Item.Merge(m, src)
}
func (m *Item) XXX_Size() int {
return xxx_messageInfo_Item.Size(m)
}
func (m *Item) XXX_DiscardUnknown() {
xxx_messageInfo_Item.DiscardUnknown(m)
}
var xxx_messageInfo_Item proto.InternalMessageInfo
func (m *Item) Reset() { *m = Item{} }
func (m *Item) String() string { return proto1.CompactTextString(m) }
func (*Item) ProtoMessage() {}
func (*Item) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Item) GetTitle() string {
if m != nil {
@ -116,37 +109,14 @@ func (m *Item) GetVat() uint64 {
}
type ContactPoint struct {
Medium string `protobuf:"bytes,1,opt,name=medium,proto3" json:"medium,omitempty"`
Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Medium string `protobuf:"bytes,1,opt,name=medium" json:"medium,omitempty"`
Contact string `protobuf:"bytes,2,opt,name=contact" json:"contact,omitempty"`
}
func (m *ContactPoint) Reset() { *m = ContactPoint{} }
func (m *ContactPoint) String() string { return proto.CompactTextString(m) }
func (*ContactPoint) ProtoMessage() {}
func (*ContactPoint) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{1}
}
func (m *ContactPoint) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ContactPoint.Unmarshal(m, b)
}
func (m *ContactPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ContactPoint.Marshal(b, m, deterministic)
}
func (m *ContactPoint) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContactPoint.Merge(m, src)
}
func (m *ContactPoint) XXX_Size() int {
return xxx_messageInfo_ContactPoint.Size(m)
}
func (m *ContactPoint) XXX_DiscardUnknown() {
xxx_messageInfo_ContactPoint.DiscardUnknown(m)
}
var xxx_messageInfo_ContactPoint proto.InternalMessageInfo
func (m *ContactPoint) Reset() { *m = ContactPoint{} }
func (m *ContactPoint) String() string { return proto1.CompactTextString(m) }
func (*ContactPoint) ProtoMessage() {}
func (*ContactPoint) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *ContactPoint) GetMedium() string {
if m != nil {
@ -163,45 +133,24 @@ func (m *ContactPoint) GetContact() string {
}
type Invoice struct {
Item []*Item `protobuf:"bytes,1,rep,name=item,proto3" json:"item,omitempty"`
InvoicerBilling []string `protobuf:"bytes,2,rep,name=invoicer_billing,json=invoicerBilling,proto3" json:"invoicer_billing,omitempty"`
InvoicerContact []*ContactPoint `protobuf:"bytes,3,rep,name=invoicer_contact,json=invoicerContact,proto3" json:"invoicer_contact,omitempty"`
CustomerBilling []string `protobuf:"bytes,4,rep,name=customer_billing,json=customerBilling,proto3" json:"customer_billing,omitempty"`
InvoicerVatId string `protobuf:"bytes,5,opt,name=invoicer_vat_id,json=invoicerVatId,proto3" json:"invoicer_vat_id,omitempty"`
CustomerVatId string `protobuf:"bytes,6,opt,name=customer_vat_id,json=customerVatId,proto3" json:"customer_vat_id,omitempty"`
ReverseVat bool `protobuf:"varint,7,opt,name=reverse_vat,json=reverseVat,proto3" json:"reverse_vat,omitempty"`
DaysDue int64 `protobuf:"varint,8,opt,name=days_due,json=daysDue,proto3" json:"days_due,omitempty"`
Iban string `protobuf:"bytes,9,opt,name=iban,proto3" json:"iban,omitempty"`
Swift string `protobuf:"bytes,10,opt,name=swift,proto3" json:"swift,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Item []*Item `protobuf:"bytes,1,rep,name=item" json:"item,omitempty"`
InvoicerBilling []string `protobuf:"bytes,2,rep,name=invoicer_billing,json=invoicerBilling" json:"invoicer_billing,omitempty"`
InvoicerContact []*ContactPoint `protobuf:"bytes,3,rep,name=invoicer_contact,json=invoicerContact" json:"invoicer_contact,omitempty"`
CustomerBilling []string `protobuf:"bytes,4,rep,name=customer_billing,json=customerBilling" json:"customer_billing,omitempty"`
InvoicerVatId string `protobuf:"bytes,5,opt,name=invoicer_vat_id,json=invoicerVatId" json:"invoicer_vat_id,omitempty"`
InvoicerCompanyNumber string `protobuf:"bytes,12,opt,name=invoicer_company_number,json=invoicerCompanyNumber" json:"invoicer_company_number,omitempty"`
CustomerVatId string `protobuf:"bytes,6,opt,name=customer_vat_id,json=customerVatId" json:"customer_vat_id,omitempty"`
ReverseVat bool `protobuf:"varint,7,opt,name=reverse_vat,json=reverseVat" json:"reverse_vat,omitempty"`
UsCustomer bool `protobuf:"varint,11,opt,name=us_customer,json=usCustomer" json:"us_customer,omitempty"`
DaysDue int64 `protobuf:"varint,8,opt,name=days_due,json=daysDue" json:"days_due,omitempty"`
Iban string `protobuf:"bytes,9,opt,name=iban" json:"iban,omitempty"`
Swift string `protobuf:"bytes,10,opt,name=swift" json:"swift,omitempty"`
}
func (m *Invoice) Reset() { *m = Invoice{} }
func (m *Invoice) String() string { return proto.CompactTextString(m) }
func (*Invoice) ProtoMessage() {}
func (*Invoice) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{2}
}
func (m *Invoice) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Invoice.Unmarshal(m, b)
}
func (m *Invoice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Invoice.Marshal(b, m, deterministic)
}
func (m *Invoice) XXX_Merge(src proto.Message) {
xxx_messageInfo_Invoice.Merge(m, src)
}
func (m *Invoice) XXX_Size() int {
return xxx_messageInfo_Invoice.Size(m)
}
func (m *Invoice) XXX_DiscardUnknown() {
xxx_messageInfo_Invoice.DiscardUnknown(m)
}
var xxx_messageInfo_Invoice proto.InternalMessageInfo
func (m *Invoice) Reset() { *m = Invoice{} }
func (m *Invoice) String() string { return proto1.CompactTextString(m) }
func (*Invoice) ProtoMessage() {}
func (*Invoice) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Invoice) GetItem() []*Item {
if m != nil {
@ -238,6 +187,13 @@ func (m *Invoice) GetInvoicerVatId() string {
return ""
}
func (m *Invoice) GetInvoicerCompanyNumber() string {
if m != nil {
return m.InvoicerCompanyNumber
}
return ""
}
func (m *Invoice) GetCustomerVatId() string {
if m != nil {
return m.CustomerVatId
@ -252,6 +208,13 @@ func (m *Invoice) GetReverseVat() bool {
return false
}
func (m *Invoice) GetUsCustomer() bool {
if m != nil {
return m.UsCustomer
}
return false
}
func (m *Invoice) GetDaysDue() int64 {
if m != nil {
return m.DaysDue
@ -274,36 +237,13 @@ func (m *Invoice) GetSwift() string {
}
type CreateInvoiceRequest struct {
Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice" json:"invoice,omitempty"`
}
func (m *CreateInvoiceRequest) Reset() { *m = CreateInvoiceRequest{} }
func (m *CreateInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*CreateInvoiceRequest) ProtoMessage() {}
func (*CreateInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{3}
}
func (m *CreateInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateInvoiceRequest.Unmarshal(m, b)
}
func (m *CreateInvoiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateInvoiceRequest.Marshal(b, m, deterministic)
}
func (m *CreateInvoiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateInvoiceRequest.Merge(m, src)
}
func (m *CreateInvoiceRequest) XXX_Size() int {
return xxx_messageInfo_CreateInvoiceRequest.Size(m)
}
func (m *CreateInvoiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateInvoiceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateInvoiceRequest proto.InternalMessageInfo
func (m *CreateInvoiceRequest) Reset() { *m = CreateInvoiceRequest{} }
func (m *CreateInvoiceRequest) String() string { return proto1.CompactTextString(m) }
func (*CreateInvoiceRequest) ProtoMessage() {}
func (*CreateInvoiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *CreateInvoiceRequest) GetInvoice() *Invoice {
if m != nil {
@ -314,36 +254,13 @@ func (m *CreateInvoiceRequest) GetInvoice() *Invoice {
type CreateInvoiceResponse struct {
// Unique invoice ID
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"`
}
func (m *CreateInvoiceResponse) Reset() { *m = CreateInvoiceResponse{} }
func (m *CreateInvoiceResponse) String() string { return proto.CompactTextString(m) }
func (*CreateInvoiceResponse) ProtoMessage() {}
func (*CreateInvoiceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{4}
}
func (m *CreateInvoiceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateInvoiceResponse.Unmarshal(m, b)
}
func (m *CreateInvoiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateInvoiceResponse.Marshal(b, m, deterministic)
}
func (m *CreateInvoiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateInvoiceResponse.Merge(m, src)
}
func (m *CreateInvoiceResponse) XXX_Size() int {
return xxx_messageInfo_CreateInvoiceResponse.Size(m)
}
func (m *CreateInvoiceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateInvoiceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateInvoiceResponse proto.InternalMessageInfo
func (m *CreateInvoiceResponse) Reset() { *m = CreateInvoiceResponse{} }
func (m *CreateInvoiceResponse) String() string { return proto1.CompactTextString(m) }
func (*CreateInvoiceResponse) ProtoMessage() {}
func (*CreateInvoiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *CreateInvoiceResponse) GetUid() string {
if m != nil {
@ -353,36 +270,13 @@ func (m *CreateInvoiceResponse) GetUid() string {
}
type GetInvoiceRequest struct {
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"`
}
func (m *GetInvoiceRequest) Reset() { *m = GetInvoiceRequest{} }
func (m *GetInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*GetInvoiceRequest) ProtoMessage() {}
func (*GetInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{5}
}
func (m *GetInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetInvoiceRequest.Unmarshal(m, b)
}
func (m *GetInvoiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetInvoiceRequest.Marshal(b, m, deterministic)
}
func (m *GetInvoiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetInvoiceRequest.Merge(m, src)
}
func (m *GetInvoiceRequest) XXX_Size() int {
return xxx_messageInfo_GetInvoiceRequest.Size(m)
}
func (m *GetInvoiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetInvoiceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetInvoiceRequest proto.InternalMessageInfo
func (m *GetInvoiceRequest) Reset() { *m = GetInvoiceRequest{} }
func (m *GetInvoiceRequest) String() string { return proto1.CompactTextString(m) }
func (*GetInvoiceRequest) ProtoMessage() {}
func (*GetInvoiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *GetInvoiceRequest) GetUid() string {
if m != nil {
@ -392,38 +286,15 @@ func (m *GetInvoiceRequest) GetUid() string {
}
type GetInvoiceResponse struct {
Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice,proto3" json:"invoice,omitempty"`
State GetInvoiceResponse_State `protobuf:"varint,2,opt,name=state,proto3,enum=proto.GetInvoiceResponse_State" json:"state,omitempty"`
FinalUid string `protobuf:"bytes,3,opt,name=final_uid,json=finalUid,proto3" json:"final_uid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Invoice *Invoice `protobuf:"bytes,1,opt,name=invoice" json:"invoice,omitempty"`
State GetInvoiceResponse_State `protobuf:"varint,2,opt,name=state,enum=proto.GetInvoiceResponse_State" json:"state,omitempty"`
FinalUid string `protobuf:"bytes,3,opt,name=final_uid,json=finalUid" json:"final_uid,omitempty"`
}
func (m *GetInvoiceResponse) Reset() { *m = GetInvoiceResponse{} }
func (m *GetInvoiceResponse) String() string { return proto.CompactTextString(m) }
func (*GetInvoiceResponse) ProtoMessage() {}
func (*GetInvoiceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{6}
}
func (m *GetInvoiceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetInvoiceResponse.Unmarshal(m, b)
}
func (m *GetInvoiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetInvoiceResponse.Marshal(b, m, deterministic)
}
func (m *GetInvoiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetInvoiceResponse.Merge(m, src)
}
func (m *GetInvoiceResponse) XXX_Size() int {
return xxx_messageInfo_GetInvoiceResponse.Size(m)
}
func (m *GetInvoiceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetInvoiceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetInvoiceResponse proto.InternalMessageInfo
func (m *GetInvoiceResponse) Reset() { *m = GetInvoiceResponse{} }
func (m *GetInvoiceResponse) String() string { return proto1.CompactTextString(m) }
func (*GetInvoiceResponse) ProtoMessage() {}
func (*GetInvoiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *GetInvoiceResponse) GetInvoice() *Invoice {
if m != nil {
@ -447,36 +318,13 @@ func (m *GetInvoiceResponse) GetFinalUid() string {
}
type RenderInvoiceRequest struct {
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"`
}
func (m *RenderInvoiceRequest) Reset() { *m = RenderInvoiceRequest{} }
func (m *RenderInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*RenderInvoiceRequest) ProtoMessage() {}
func (*RenderInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{7}
}
func (m *RenderInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RenderInvoiceRequest.Unmarshal(m, b)
}
func (m *RenderInvoiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RenderInvoiceRequest.Marshal(b, m, deterministic)
}
func (m *RenderInvoiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_RenderInvoiceRequest.Merge(m, src)
}
func (m *RenderInvoiceRequest) XXX_Size() int {
return xxx_messageInfo_RenderInvoiceRequest.Size(m)
}
func (m *RenderInvoiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_RenderInvoiceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_RenderInvoiceRequest proto.InternalMessageInfo
func (m *RenderInvoiceRequest) Reset() { *m = RenderInvoiceRequest{} }
func (m *RenderInvoiceRequest) String() string { return proto1.CompactTextString(m) }
func (*RenderInvoiceRequest) ProtoMessage() {}
func (*RenderInvoiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *RenderInvoiceRequest) GetUid() string {
if m != nil {
@ -486,36 +334,13 @@ func (m *RenderInvoiceRequest) GetUid() string {
}
type RenderInvoiceResponse struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *RenderInvoiceResponse) Reset() { *m = RenderInvoiceResponse{} }
func (m *RenderInvoiceResponse) String() string { return proto.CompactTextString(m) }
func (*RenderInvoiceResponse) ProtoMessage() {}
func (*RenderInvoiceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{8}
}
func (m *RenderInvoiceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RenderInvoiceResponse.Unmarshal(m, b)
}
func (m *RenderInvoiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RenderInvoiceResponse.Marshal(b, m, deterministic)
}
func (m *RenderInvoiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_RenderInvoiceResponse.Merge(m, src)
}
func (m *RenderInvoiceResponse) XXX_Size() int {
return xxx_messageInfo_RenderInvoiceResponse.Size(m)
}
func (m *RenderInvoiceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_RenderInvoiceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_RenderInvoiceResponse proto.InternalMessageInfo
func (m *RenderInvoiceResponse) Reset() { *m = RenderInvoiceResponse{} }
func (m *RenderInvoiceResponse) String() string { return proto1.CompactTextString(m) }
func (*RenderInvoiceResponse) ProtoMessage() {}
func (*RenderInvoiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func (m *RenderInvoiceResponse) GetData() []byte {
if m != nil {
@ -525,36 +350,13 @@ func (m *RenderInvoiceResponse) GetData() []byte {
}
type SealInvoiceRequest struct {
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"`
}
func (m *SealInvoiceRequest) Reset() { *m = SealInvoiceRequest{} }
func (m *SealInvoiceRequest) String() string { return proto.CompactTextString(m) }
func (*SealInvoiceRequest) ProtoMessage() {}
func (*SealInvoiceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{9}
}
func (m *SealInvoiceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SealInvoiceRequest.Unmarshal(m, b)
}
func (m *SealInvoiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SealInvoiceRequest.Marshal(b, m, deterministic)
}
func (m *SealInvoiceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SealInvoiceRequest.Merge(m, src)
}
func (m *SealInvoiceRequest) XXX_Size() int {
return xxx_messageInfo_SealInvoiceRequest.Size(m)
}
func (m *SealInvoiceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SealInvoiceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SealInvoiceRequest proto.InternalMessageInfo
func (m *SealInvoiceRequest) Reset() { *m = SealInvoiceRequest{} }
func (m *SealInvoiceRequest) String() string { return proto1.CompactTextString(m) }
func (*SealInvoiceRequest) ProtoMessage() {}
func (*SealInvoiceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
func (m *SealInvoiceRequest) GetUid() string {
if m != nil {
@ -564,94 +366,26 @@ func (m *SealInvoiceRequest) GetUid() string {
}
type SealInvoiceResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SealInvoiceResponse) Reset() { *m = SealInvoiceResponse{} }
func (m *SealInvoiceResponse) String() string { return proto.CompactTextString(m) }
func (*SealInvoiceResponse) ProtoMessage() {}
func (*SealInvoiceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_aca47770af3442cd, []int{10}
}
func (m *SealInvoiceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SealInvoiceResponse.Unmarshal(m, b)
}
func (m *SealInvoiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SealInvoiceResponse.Marshal(b, m, deterministic)
}
func (m *SealInvoiceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SealInvoiceResponse.Merge(m, src)
}
func (m *SealInvoiceResponse) XXX_Size() int {
return xxx_messageInfo_SealInvoiceResponse.Size(m)
}
func (m *SealInvoiceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SealInvoiceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SealInvoiceResponse proto.InternalMessageInfo
func (m *SealInvoiceResponse) Reset() { *m = SealInvoiceResponse{} }
func (m *SealInvoiceResponse) String() string { return proto1.CompactTextString(m) }
func (*SealInvoiceResponse) ProtoMessage() {}
func (*SealInvoiceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
func init() {
proto.RegisterEnum("proto.GetInvoiceResponse_State", GetInvoiceResponse_State_name, GetInvoiceResponse_State_value)
proto.RegisterType((*Item)(nil), "proto.Item")
proto.RegisterType((*ContactPoint)(nil), "proto.ContactPoint")
proto.RegisterType((*Invoice)(nil), "proto.Invoice")
proto.RegisterType((*CreateInvoiceRequest)(nil), "proto.CreateInvoiceRequest")
proto.RegisterType((*CreateInvoiceResponse)(nil), "proto.CreateInvoiceResponse")
proto.RegisterType((*GetInvoiceRequest)(nil), "proto.GetInvoiceRequest")
proto.RegisterType((*GetInvoiceResponse)(nil), "proto.GetInvoiceResponse")
proto.RegisterType((*RenderInvoiceRequest)(nil), "proto.RenderInvoiceRequest")
proto.RegisterType((*RenderInvoiceResponse)(nil), "proto.RenderInvoiceResponse")
proto.RegisterType((*SealInvoiceRequest)(nil), "proto.SealInvoiceRequest")
proto.RegisterType((*SealInvoiceResponse)(nil), "proto.SealInvoiceResponse")
}
func init() { proto.RegisterFile("inboice.proto", fileDescriptor_aca47770af3442cd) }
var fileDescriptor_aca47770af3442cd = []byte{
// 623 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdf, 0x4f, 0x13, 0x41,
0x10, 0xf6, 0x7a, 0x57, 0xda, 0x4e, 0x29, 0x96, 0x01, 0xcc, 0x02, 0x1a, 0x9a, 0x4b, 0x24, 0x47,
0x4c, 0x88, 0xa9, 0xf1, 0xd5, 0x50, 0x29, 0x9a, 0x1a, 0x14, 0xb2, 0x45, 0x5e, 0x2f, 0xdb, 0xbb,
0xc5, 0x6c, 0xd2, 0xde, 0xe1, 0xdd, 0x5e, 0x8d, 0xff, 0x93, 0x7f, 0x8e, 0x7f, 0x8b, 0xcf, 0x66,
0x7f, 0x5c, 0x29, 0xf4, 0x0c, 0x3e, 0x75, 0xe7, 0x9b, 0x6f, 0xbf, 0xf9, 0x76, 0x66,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 0xf6, 0x4f, 0xa0, 0xae, 0xc9, 0xb8, 0x09, 0x9d, 0xf1, 0xd5, 0xe0, 0xea, 0x2c, 0x1c, 0x7d,
0xb9, 0x1e, 0x9c, 0x8f, 0x86, 0xdd, 0x27, 0x88, 0xb0, 0x61, 0xa0, 0x4b, 0x7a, 0xf1, 0xe1, 0x82,
0x7e, 0x1e, 0x74, 0x1d, 0xec, 0xc2, 0xba, 0xc1, 0xc6, 0x67, 0x83, 0xf3, 0xb3, 0x61, 0xb7, 0xe6,
0x07, 0xb0, 0x4d, 0x79, 0x12, 0xf3, 0xec, 0xd1, 0x06, 0xbc, 0x82, 0x9d, 0x07, 0x4c, 0xdb, 0x02,
0x04, 0x2f, 0x66, 0x92, 0x69, 0xee, 0x3a, 0xd5, 0x67, 0xff, 0x10, 0x70, 0xcc, 0xd9, 0xf4, 0x51,
0xd1, 0x1d, 0xd8, 0xba, 0xc7, 0x33, 0x92, 0xfd, 0x5f, 0xfa, 0xcb, 0xd3, 0xff, 0x1c, 0xf8, 0x09,
0x3a, 0xf7, 0x46, 0x89, 0xfb, 0xe5, 0x47, 0x52, 0xb1, 0x22, 0x7b, 0xcf, 0xab, 0x93, 0xd6, 0xea,
0x00, 0xe0, 0xae, 0xdf, 0x48, 0x2a, 0x46, 0x60, 0x54, 0x76, 0xff, 0x39, 0x1c, 0x3c, 0x87, 0xce,
0xbd, 0x36, 0x2c, 0xec, 0x54, 0xb5, 0x71, 0x61, 0xa7, 0xb2, 0x73, 0xaf, 0x1d, 0x1c, 0x42, 0x7b,
0xe9, 0xfd, 0x58, 0xd6, 0x5d, 0xed, 0xdd, 0xde, 0x5e, 0x55, 0xca, 0xe8, 0x4c, 0xd6, 0x74, 0xea,
0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0xc3, 0xf1, 0x18, 0x6e, 0x05, 0x00, 0x00,
proto1.RegisterType((*Item)(nil), "proto.Item")
proto1.RegisterType((*ContactPoint)(nil), "proto.ContactPoint")
proto1.RegisterType((*Invoice)(nil), "proto.Invoice")
proto1.RegisterType((*CreateInvoiceRequest)(nil), "proto.CreateInvoiceRequest")
proto1.RegisterType((*CreateInvoiceResponse)(nil), "proto.CreateInvoiceResponse")
proto1.RegisterType((*GetInvoiceRequest)(nil), "proto.GetInvoiceRequest")
proto1.RegisterType((*GetInvoiceResponse)(nil), "proto.GetInvoiceResponse")
proto1.RegisterType((*RenderInvoiceRequest)(nil), "proto.RenderInvoiceRequest")
proto1.RegisterType((*RenderInvoiceResponse)(nil), "proto.RenderInvoiceResponse")
proto1.RegisterType((*SealInvoiceRequest)(nil), "proto.SealInvoiceRequest")
proto1.RegisterType((*SealInvoiceResponse)(nil), "proto.SealInvoiceResponse")
proto1.RegisterEnum("proto.GetInvoiceResponse_State", GetInvoiceResponse_State_name, GetInvoiceResponse_State_value)
}
// Reference imports to suppress errors if they are not otherwise used.
@ -662,9 +396,8 @@ var _ grpc.ClientConn
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// InboiceClient is the client API for Inboice service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
// Client API for Inboice service
type InboiceClient interface {
CreateInvoice(ctx context.Context, in *CreateInvoiceRequest, opts ...grpc.CallOption) (*CreateInvoiceResponse, error)
GetInvoice(ctx context.Context, in *GetInvoiceRequest, opts ...grpc.CallOption) (*GetInvoiceResponse, error)
@ -682,7 +415,7 @@ func NewInboiceClient(cc *grpc.ClientConn) InboiceClient {
func (c *inboiceClient) CreateInvoice(ctx context.Context, in *CreateInvoiceRequest, opts ...grpc.CallOption) (*CreateInvoiceResponse, error) {
out := new(CreateInvoiceResponse)
err := c.cc.Invoke(ctx, "/proto.Inboice/CreateInvoice", in, out, opts...)
err := grpc.Invoke(ctx, "/proto.Inboice/CreateInvoice", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
@ -691,7 +424,7 @@ func (c *inboiceClient) CreateInvoice(ctx context.Context, in *CreateInvoiceRequ
func (c *inboiceClient) GetInvoice(ctx context.Context, in *GetInvoiceRequest, opts ...grpc.CallOption) (*GetInvoiceResponse, error) {
out := new(GetInvoiceResponse)
err := c.cc.Invoke(ctx, "/proto.Inboice/GetInvoice", in, out, opts...)
err := grpc.Invoke(ctx, "/proto.Inboice/GetInvoice", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
@ -699,7 +432,7 @@ func (c *inboiceClient) GetInvoice(ctx context.Context, in *GetInvoiceRequest, o
}
func (c *inboiceClient) RenderInvoice(ctx context.Context, in *RenderInvoiceRequest, opts ...grpc.CallOption) (Inboice_RenderInvoiceClient, error) {
stream, err := c.cc.NewStream(ctx, &_Inboice_serviceDesc.Streams[0], "/proto.Inboice/RenderInvoice", opts...)
stream, err := grpc.NewClientStream(ctx, &_Inboice_serviceDesc.Streams[0], c.cc, "/proto.Inboice/RenderInvoice", opts...)
if err != nil {
return nil, err
}
@ -732,14 +465,15 @@ func (x *inboiceRenderInvoiceClient) Recv() (*RenderInvoiceResponse, error) {
func (c *inboiceClient) SealInvoice(ctx context.Context, in *SealInvoiceRequest, opts ...grpc.CallOption) (*SealInvoiceResponse, error) {
out := new(SealInvoiceResponse)
err := c.cc.Invoke(ctx, "/proto.Inboice/SealInvoice", in, out, opts...)
err := grpc.Invoke(ctx, "/proto.Inboice/SealInvoice", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// InboiceServer is the server API for Inboice service.
// Server API for Inboice service
type InboiceServer interface {
CreateInvoice(context.Context, *CreateInvoiceRequest) (*CreateInvoiceResponse, error)
GetInvoice(context.Context, *GetInvoiceRequest) (*GetInvoiceResponse, error)
@ -852,3 +586,51 @@ var _Inboice_serviceDesc = grpc.ServiceDesc{
},
Metadata: "inboice.proto",
}
func init() { proto1.RegisterFile("inboice.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 663 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,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 0x03, 0x7d, 0xf6,
0xf6, 0x01, 0x47, 0x8c, 0x4e, 0x1e, 0x15, 0xed, 0xc0, 0xe6, 0x1d, 0x9e, 0x91, 0xec, 0xfd, 0x2a,
0xa9, 0x4f, 0x5a, 0xff, 0x25, 0xe1, 0x17, 0x68, 0xdd, 0x19, 0x25, 0xee, 0x16, 0x5f, 0xdf, 0x8a,
0x15, 0xd9, 0x79, 0xb1, 0x3a, 0x69, 0xad, 0xf6, 0x01, 0x6e, 0xfb, 0x8d, 0x64, 0xc5, 0x08, 0x8c,
0xca, 0xf6, 0x3f, 0x87, 0x83, 0xa7, 0xd0, 0xba, 0xd3, 0x86, 0x85, 0x9d, 0x55, 0x6d, 0x5c, 0xd8,
0x59, 0xd9, 0xb9, 0x37, 0x0e, 0x0e, 0xa0, 0xb1, 0xf4, 0x7e, 0x2c, 0xea, 0x3e, 0xec, 0xdd, 0xce,
0xce, 0xaa, 0x94, 0xd1, 0x19, 0xaf, 0xe9, 0xd4, 0xdb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1,
0x22, 0x88, 0x46, 0xc7, 0x05, 0x00, 0x00,
}

View File

@ -35,32 +35,36 @@ func renderInvoicePDF(i *pb.Invoice, number string, proforma bool) ([]byte, erro
}
data := struct {
InvoiceNumber string
InvoicerBilling []string
InvoicerVAT string
InvoiceeBilling []string
InvoiceeVAT string
Date time.Time
DueDate time.Time
IBAN string
SWIFT string
Proforma bool
ReverseVAT bool
Items []item
TotalNet string
VATTotal string
Total string
DeliveryCharge string
InvoiceNumber string
InvoicerBilling []string
InvoicerVAT string
InvoicerCompanyNumber string
InvoiceeBilling []string
InvoiceeVAT string
Date time.Time
DueDate time.Time
IBAN string
SWIFT string
Proforma bool
ReverseVAT bool
USCustomer bool
Items []item
TotalNet string
VATTotal string
Total string
DeliveryCharge string
}{
InvoiceNumber: number,
Date: now,
DueDate: now.AddDate(0, 0, int(i.DaysDue)),
IBAN: i.Iban,
SWIFT: i.Swift,
InvoicerVAT: i.InvoicerVatId,
InvoiceeVAT: i.CustomerVatId,
Proforma: proforma,
ReverseVAT: true,
InvoiceNumber: number,
Date: now,
DueDate: now.AddDate(0, 0, int(i.DaysDue)),
IBAN: i.Iban,
SWIFT: i.Swift,
InvoicerVAT: i.InvoicerVatId,
InvoicerCompanyNumber: i.InvoicerCompanyNumber,
InvoiceeVAT: i.CustomerVatId,
Proforma: proforma,
ReverseVAT: i.ReverseVat,
USCustomer: i.UsCustomer,
InvoicerBilling: make([]string, len(i.InvoicerBilling)),
InvoiceeBilling: make([]string, len(i.CustomerBilling)),

View File

@ -104,7 +104,10 @@ div.bgtext div {
<li>{{ $e }}</li>
{{ end }}
{{ end }}
<li><b>VAT Number:</b> {{ .InvoicerVAT }}</li>
{{ if .InvoicerCompanyNumber }}
<li><b>Company Registration Number:</b> {{ .InvoicerCompanyNumber }}</li>
{{ end }}
<li><b>Tax Number:</b> {{ .InvoicerVAT }}</li>
</ul>
</div>
<div class="metadata">
@ -132,7 +135,12 @@ div.bgtext div {
<li>{{ $e }}</li>
{{ end }}
{{ end }}
{{ if .USCustomer }}
<li>EIN: {{ .InvoiceeVAT }}</li>
<li><b>(VAT zero rate)</b></li>
{{ else }}
<li>VAT Number: {{ .InvoiceeVAT }}</li>
{{ end }}
{{ if .ReverseVAT }}
<li><b>(reverse charge applies)</b></li>
@ -161,15 +169,11 @@ div.bgtext div {
</tr>
{{ end }}
<tr>
<td colspan="5" class="lhead">Net Total</td>
<td colspan="5" class="lhead">Subtotal without VAT</td>
<td>{{ .TotalNet }}</td>
</tr>
<tr>
<td colspan="5" class="lhead">Delivery Charge</td>
<td>{{ .DeliveryCharge }}</td>
</tr>
<tr>
<td colspan="5" class="lhead">VAT Total{{ if .ReverseVAT }} (reverse charge applies){{ end }}</td>
<td colspan="5" class="lhead">VAT Total{{ if .ReverseVAT }} (reverse charge applies){{ end }} {{ if .USCustomer }}(VAT zero rate){{ end }}</td>
<td>{{ .VATTotal }}</td>
</tr>
<tr>