add tested/not tested indicator on print view
All checks were successful
Go / build (push) Successful in 12m19s

This commit is contained in:
2025-07-02 00:10:37 +02:00
parent 6c59d1233f
commit 9e638dcfc2
5 changed files with 71 additions and 2 deletions

View File

@@ -180,7 +180,19 @@ func (rc *printController) PrintHandler(c *gin.Context) {
executeJobs := func() {
for _, printJob := range printJobs {
printJob.Execute()
printJob.ShopItem.WasPrinted = true
_, err = repositories.ShopItems.Update(printJob.ShopItem)
if err != nil {
fmt.Printf("Error: %s\n", err)
}
err := printJob.Execute()
if err == nil {
return
}
}
}

View File

@@ -161,6 +161,7 @@ func (rc *shopItemController) NewShopItemFromForm(ctx *gin.Context) (models.Shop
Pdf: dstPdf,
Variants: variants,
PrintMode: printMode,
WasPrinted: false,
}
fmt.Println("Creating Shopitem: ", shopItem)
@@ -400,6 +401,7 @@ func (rc *shopItemController) AddItemsHandler(c *gin.Context) {
Pdf: dstPdf,
Variants: variants,
PrintMode: "CreateBooklet",
WasPrinted: false,
}
_, err = repositories.ShopItems.Create(shopItem)
@@ -537,6 +539,7 @@ func (rc *shopItemController) EditItemHandler(c *gin.Context) {
newShopItem.Variants = shopItem.Variants
newShopItem.BasePrice = shopItem.BasePrice
newShopItem.IsPublic = shopItem.IsPublic
newShopItem.WasPrinted = false
if len(shopItem.Tags) != 0 {
newShopItem.Tags = shopItem.Tags