add tested/not tested indicator on print view
All checks were successful
Go / build (push) Successful in 12m19s
All checks were successful
Go / build (push) Successful in 12m19s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user