Merge pull request 'Show Tax in Article Edit View. Fixes #48' (#49) from feature/48_not_showing_tax_edit_view into master

This commit is contained in:
Hendrik Schutter 2020-06-02 07:47:04 +02:00
commit 72ddfa42ef
2 changed files with 19 additions and 12 deletions

View File

@ -1,15 +1,5 @@
package org.hso.ecommerce.controller.intern;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import javax.imageio.ImageIO;
import org.hso.ecommerce.entities.shop.Article;
import org.hso.ecommerce.entities.shop.Category;
import org.hso.ecommerce.entities.shop.Image;
@ -27,6 +17,16 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.view.RedirectView;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Controller
@RequestMapping("intern/articles")
public class InternArticleController {
@ -243,6 +243,7 @@ public class InternArticleController {
public boolean shouldReorder;
public String warehouseUnitsPerSlot;
public String description;
public int vatPercent;
public String getImgPath() {
return imgPath;
@ -268,6 +269,10 @@ public class InternArticleController {
this.price = price;
}
public int getVatPercent() {
return vatPercent;
}
public String getPrice_netto() {
return price_netto;
}
@ -363,6 +368,7 @@ public class InternArticleController {
this.shouldReorder = article.shouldReorder;
this.warehouseUnitsPerSlot = String.valueOf(article.warehouseUnitsPerSlot);
this.description = article.description;
this.vatPercent = article.related.vatPercent;
}
}

View File

@ -47,8 +47,9 @@
<div class="s">
<p>
<label for="price">Preis (Netto)</label>
<input class="" type="number" id="price" step="0.01" name="price_netto" required th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/>
(19% Mwst.)
<input class="" type="number" id="price" step="0.01" name="price_netto" required
th:value="${ArticleID.price_netto}"/>&nbsp;EUR <br/>
(<span th:text="${ArticleID.vatPercent}"></span>% Mwst.)
<!-- Info von article ref--> <br/>
= <span th:text="${ArticleID.price}"></span>&nbsp;EUR Brutto
</p>