mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
wip: invoice reference generation
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/sessions"
|
||||
@@ -267,3 +268,9 @@ func GenerateInvoice(invoice types.Invoice, user types.User, client types.Client
|
||||
|
||||
return invoicePath, nil
|
||||
}
|
||||
|
||||
func GenerateInvoiceReference(invoiceNumber uint32) string {
|
||||
year, _, _ := time.Now().Date()
|
||||
|
||||
return fmt.Sprintf("INV/%d/%05d", year, invoiceNumber)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user