Commit 58637248 authored by 勾芒's avatar 勾芒

修复所有显示金额

parent c03e5b1c
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
for (ShopcarModel *model in _goodsAllprice) { for (ShopcarModel *model in _goodsAllprice) {
allNumber += model.goodsNum; allNumber += model.goodsNum;
allPrice += [model.goods.costPrice floatValue] *model.goodsNum; allPrice += [model.costPrice floatValue] *model.goodsNum;
} }
self.goodsAllNumber.text = [NSString stringWithFormat:@"%ld",allNumber]; self.goodsAllNumber.text = [NSString stringWithFormat:@"%ld",allNumber];
self.goodsAllPrice.text = [NSString stringWithFormat:@"¥%.2f",allPrice]; self.goodsAllPrice.text = [NSString stringWithFormat:@"¥%.2f",allPrice];
......
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
self.specifications.text = _model.goods.size; self.specifications.text = _model.goods.size;
self.goodsCode.text = _model.goods.code; self.goodsCode.text = _model.goods.code;
self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%d",_model.goodsNum]; self.goodsNumber.text = [NSString stringWithFormat:@"数量 X%d",_model.goodsNum];
self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%.2f",[_model.goods.costPrice floatValue]]; self.clinchPrice.text = [NSString stringWithFormat:@"成交价 ¥%.2f",[_model.costPrice floatValue]];
//计算总价格 //计算总价格
NSInteger number = _model.goodsNum; NSInteger number = _model.goodsNum;
CGFloat price = [_model.goods.costPrice floatValue]; CGFloat price = [_model.costPrice floatValue];
CGFloat allPrice = number*price; CGFloat allPrice = number*price;
self.totalPrice.text = [NSString stringWithFormat:@"¥%.2f",allPrice]; self.totalPrice.text = [NSString stringWithFormat:@"¥%.2f",allPrice];
} }
......
...@@ -393,15 +393,15 @@ ...@@ -393,15 +393,15 @@
orderGoods.goodsName = model.goods.name; orderGoods.goodsName = model.goods.name;
orderGoods.goodsBrand = model.goods.brandId; orderGoods.goodsBrand = model.goods.brandId;
orderGoods.goodsNum = [NSString stringWithFormat:@"%d",model.goodsNum]; orderGoods.goodsNum = [NSString stringWithFormat:@"%d",model.goodsNum];
orderGoods.goodsPrice = model.goods.costPrice; orderGoods.goodsPrice = model.costPrice;
orderGoods.remark = model.goods.spec; orderGoods.remark = model.goods.spec;
orderGoods.goodsUnit = model.goods.unit; orderGoods.goodsUnit = model.goods.unit;
//总价 //总价
allPrice += model.goodsNum *[model.goods.costPrice floatValue]; allPrice += model.goodsNum *[model.costPrice floatValue];
//总数量 //总数量
allNumber += model.goodsNum; allNumber += model.goodsNum;
orderGoods.goodsTotalPrice = [NSNumber numberWithFloat:model.goodsNum *[model.goods.costPrice floatValue]]; orderGoods.goodsTotalPrice = [NSNumber numberWithFloat:model.goodsNum *[model.costPrice floatValue]];
[goodidArr addObject:orderGoods]; [goodidArr addObject:orderGoods];
} }
//总价 //总价
......
...@@ -39,7 +39,10 @@ ...@@ -39,7 +39,10 @@
self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue]; self.tagsPriceLabe.text = [_model.goods.tagPrice stringValue];
self.clinchTextfield.text = [_model.costPrice stringValue]?[_model.costPrice stringValue]:[_model.goods.tagPrice stringValue]; self.clinchTextfield.text = [_model.costPrice stringValue]?[_model.costPrice stringValue]:[_model.goods.tagPrice stringValue];
self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum]; self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%d",_model.goodsNum];
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text floatValue]*([_model.costPrice floatValue]?[_model.costPrice floatValue]:[_model.goods.tagPrice floatValue])];; if ([_model.costPrice integerValue] == 0) {
_model.costPrice = _model.goods.tagPrice;
}
self.productPriceLabe.text = [NSString stringWithFormat:@"¥%.2f",[self.goodsNumbersLabe.text integerValue]*[_model.costPrice floatValue]];;
} }
#pragma mark -增加或者减少商品 #pragma mark -增加或者减少商品
......
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
//保存成交价格 //保存成交价格
ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex]; ShopcarModel *Newmodel = [self.shopResponseArray objectAtIndex_opple:cellindex];
Newmodel.goods.costPrice = [NSNumber numberWithInteger:costprice]; Newmodel.costPrice = [NSNumber numberWithInteger:costprice];
// [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel]; // [self.shopResponseArray replaceObjectAtIndex:cellindex withObject:Newmodel];
[self CalculateSelectedGoodsAllprice]; [self CalculateSelectedGoodsAllprice];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment