This commit is contained in:
@@ -32,6 +32,7 @@ type Invoice struct {
|
||||
PrintJobs []PrintJob
|
||||
PricePerClick float64
|
||||
PartCosts float64
|
||||
PriceTotal float64
|
||||
}
|
||||
|
||||
type PrintJob struct {
|
||||
@@ -45,6 +46,8 @@ type PrintJob struct {
|
||||
CoverPaperTypeId *uint
|
||||
CoverPaperType *Paper `gorm:"foreignKey:CoverPaperTypeId"`
|
||||
Amount uint
|
||||
PricePerPiece float64
|
||||
PriceTotal float64
|
||||
InvoiceID uint
|
||||
}
|
||||
|
||||
@@ -134,6 +137,7 @@ func (p *PrintJob) CalculatePrintCosts() (float64, error) {
|
||||
|
||||
//Get actual pagecount depending on printmode
|
||||
actualPageCount := pageCount
|
||||
fmt.Println("PagCount: ", actualPageCount)
|
||||
|
||||
if printMode == CreateBooklet {
|
||||
dividedCount := float64(pageCount) / 4.0
|
||||
@@ -156,5 +160,7 @@ func (p *PrintJob) CalculatePrintCosts() (float64, error) {
|
||||
|
||||
fmt.Printf("Printing Costs per Zine: %v\n", printingCosts)
|
||||
fmt.Printf("Printing Costs Total: %v\n", printingCosts*float64(p.Amount))
|
||||
p.PricePerPiece = printingCosts
|
||||
p.PriceTotal = printingCosts * float64(p.Amount)
|
||||
return printingCosts, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user