|
@@ -385,6 +385,7 @@ func UpdateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
Query: repo.Map{"_id": bill.SupplierId},
|
|
|
}, supplierInfo)
|
|
|
}
|
|
|
+ units := []string{"元/吨", "元/平方米"}
|
|
|
idStatges := make(map[string]*UpdateBilltoStageReq)
|
|
|
for _, paper := range bill.Paper {
|
|
|
if len(paper.Id) == 0 {
|
|
@@ -393,17 +394,18 @@ func UpdateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
width, _ := strconv.Atoi(paper.Width)
|
|
|
Height, _ := strconv.Atoi(paper.Height)
|
|
|
idStatges[paper.Id] = &UpdateBilltoStageReq{
|
|
|
- BillType: "purchase",
|
|
|
- SupplierInfo: supplierInfo,
|
|
|
- Norm: paper.Norm,
|
|
|
- Width: width,
|
|
|
- Height: Height,
|
|
|
- Price2: paper.Price2,
|
|
|
- OrderCount: paper.OrderCount,
|
|
|
- OrderPrice: paper.OrderPrice,
|
|
|
- Remark: paper.Remark,
|
|
|
- ConfirmCount: paper.ConfirmCount,
|
|
|
- DeliveryTime: paper.DeliveryTime,
|
|
|
+ BillType: "purchase",
|
|
|
+ SupplierInfo: supplierInfo,
|
|
|
+ Norm: paper.Norm,
|
|
|
+ Width: width,
|
|
|
+ Height: Height,
|
|
|
+ Price2: paper.Price2,
|
|
|
+ OrderCount: paper.OrderCount,
|
|
|
+ OrderPrice: paper.OrderPrice,
|
|
|
+ Remark: paper.Remark,
|
|
|
+ ConfirmCount: paper.ConfirmCount,
|
|
|
+ DeliveryTime: paper.DeliveryTime,
|
|
|
+ IsChangePrice2: isInclude(paper.Price2Unit, units),
|
|
|
}
|
|
|
}
|
|
|
_, err := updateBilltoStage(c, bill.PlanId, idStatges, apictx)
|
|
@@ -423,6 +425,15 @@ func UpdateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+func isInclude(str1 string, arr []string) bool {
|
|
|
+ for _, a := range arr {
|
|
|
+ if str1 == a {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
// 删除单据
|
|
|
func DelBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
billId := c.Param("id")
|