|
@@ -294,8 +294,6 @@ public class OrderServiceImpl implements OrderService {
|
|
|
public Ticket printMsg(Long id) {
|
|
|
OrderEntity orderEntity = queryInfos(id);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
List<OrderGoodsEntity> orderGoodsEntityList = orderEntity.getOrderGoodsEntityList();
|
|
|
// 获取门店
|
|
|
StoreEntity storeEntity = storeDao.queryObject(orderEntity.getStoreId());
|
|
@@ -313,12 +311,15 @@ public class OrderServiceImpl implements OrderService {
|
|
|
// 商品信息
|
|
|
Integer goodsTotal = 0; // 商品总个数
|
|
|
BigDecimal total = Constant.ZERO; // 商品总计
|
|
|
+ BigDecimal taxTotal = Constant.ZERO; //税费总计
|
|
|
List<Goods> goodsList = new ArrayList<>();
|
|
|
for (OrderGoodsEntity orderGoods : orderGoodsEntityList) {
|
|
|
goodsTotal += orderGoods.getNumber();
|
|
|
total = total.add(orderGoods.getRetailPrice().multiply(new BigDecimal(orderGoods.getNumber())))
|
|
|
.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- Goods goods = new Goods(orderGoods.getGoodsName(), orderGoods.getRetailPrice().toString(),
|
|
|
+ taxTotal = taxTotal.add(orderGoods.getGoodsRate().multiply(orderGoods.getMarketPrice()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ Goods goods = new Goods(orderGoods.getGoodsName(), orderGoods.getMarketPrice().toString(),
|
|
|
+ orderGoods.getGoodsRate().multiply(orderGoods.getMarketPrice()).setScale(2, BigDecimal.ROUND_HALF_UP).toString(),
|
|
|
orderGoods.getNumber().toString(),
|
|
|
orderGoods.getRetailPrice().multiply(new BigDecimal(orderGoods.getNumber()))
|
|
|
.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
@@ -329,6 +330,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
CashInfo cashInfo = new CashInfo();
|
|
|
cashInfo.setGoodsTotal(goodsTotal.toString());
|
|
|
cashInfo.setTotal(total.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ cashInfo.setTaxTotal(taxTotal.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
cashInfo.setReceipts(orderEntity.getActualPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
cashInfo.setOddChange("0.00");
|
|
|
cashInfo.setCoupon(orderEntity.getCouponPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
@@ -359,8 +361,6 @@ public class OrderServiceImpl implements OrderService {
|
|
|
public Ticket printMsg(Long id, String sessionId) {
|
|
|
OrderEntity orderEntity = queryInfos(id);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
List<OrderGoodsEntity> orderGoodsEntityList = orderEntity.getOrderGoodsEntityList();
|
|
|
// 获取门店
|
|
|
StoreEntity storeEntity = storeDao.queryObject(orderEntity.getStoreId());
|
|
@@ -378,15 +378,18 @@ public class OrderServiceImpl implements OrderService {
|
|
|
// 商品信息
|
|
|
Integer goodsTotal = 0; // 商品总个数
|
|
|
BigDecimal total = Constant.ZERO; // 商品总计
|
|
|
+ BigDecimal taxTotal = Constant.ZERO; //税费总计
|
|
|
List<Goods> goodsList = new ArrayList<>();
|
|
|
for (OrderGoodsEntity orderGoods : orderGoodsEntityList) {
|
|
|
goodsTotal += orderGoods.getNumber();
|
|
|
total = total.add(orderGoods.getRetailPrice().multiply(new BigDecimal(orderGoods.getNumber())))
|
|
|
.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- Goods goods = new Goods(orderGoods.getGoodsName(), orderGoods.getRetailPrice().toString(),
|
|
|
- orderGoods.getNumber().toString(),
|
|
|
- orderGoods.getRetailPrice().multiply(new BigDecimal(orderGoods.getNumber()))
|
|
|
- .setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ taxTotal = taxTotal.add(orderGoods.getGoodsRate().multiply(orderGoods.getMarketPrice()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ Goods goods = new Goods(orderGoods.getGoodsName(), orderGoods.getMarketPrice().toString(),
|
|
|
+ orderGoods.getGoodsRate().multiply(orderGoods.getMarketPrice()).setScale(2, BigDecimal.ROUND_HALF_UP).toString(),
|
|
|
+ orderGoods.getNumber().toString(),
|
|
|
+ orderGoods.getRetailPrice().multiply(new BigDecimal(orderGoods.getNumber()))
|
|
|
+ .setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
goodsList.add(goods);
|
|
|
}
|
|
|
|
|
@@ -394,6 +397,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
CashInfo cashInfo = new CashInfo();
|
|
|
cashInfo.setGoodsTotal(goodsTotal.toString());
|
|
|
cashInfo.setTotal(total.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ cashInfo.setTaxTotal(taxTotal.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
cashInfo.setReceipts(orderEntity.getActualPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
cashInfo.setOddChange("0.00");
|
|
|
cashInfo.setCoupon(orderEntity.getCouponPrice().setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|