Commit 68eaa1ef authored by 陈俊俊's avatar 陈俊俊

数量修改

parent a4a53ec4
......@@ -46,4 +46,5 @@
+ (BOOL)checkIsPermission:(NSString *)permission;
+(UILabel *)labelWithTitle:(NSString *)title frame:(CGRect)frame textFont:(UIFont *)titleFont;
+ (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color;
+ (UIButton *)buttonWithImage:(UIImage *)image frame:(CGRect)frame;
@end
......@@ -297,5 +297,15 @@
return button;
}
+ (UIButton *)buttonWithImage:(UIImage *)image frame:(CGRect)frame
{
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = frame;
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
[button setImage:image forState:UIControlStateNormal];
return button;
}
@end
......@@ -145,17 +145,17 @@
{
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.titleLabel.text = billProduct.product_name;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",billProduct.basePrice];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",billProduct.qty,billProduct.unit];
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[billProduct.basePrice stringValue]];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",[billProduct.qty stringValue],billProduct.unit];
self.shippedQtyLabel.text = [NSString stringWithFormat:@"%@%@",billProduct.shippedBaseQty ? [billProduct.shippedBaseQty stringValue]:@"0",billProduct.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",billProduct.product_name,billProduct.product_code];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",billProduct.qpc,billProduct.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",billProduct.qty,billProduct.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",billProduct.baseQty,billProduct.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",billProduct.price];
self.showBasePriceLabel.text = [NSString stringWithFormat:@"基础单价:%@元",billProduct.basePrice];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",billProduct.total];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",[billProduct.qpc stringValue],billProduct.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",[billProduct.qty stringValue],billProduct.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",[billProduct.baseQty stringValue],billProduct.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",[billProduct.price stringValue]];
self.showBasePriceLabel.text = [NSString stringWithFormat:@"基础单价:%@元",[billProduct.basePrice stringValue]];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",[billProduct.total stringValue]];
self.showNoteLabel.text =[NSString stringWithFormat:@"备注:%@",billProduct.remark ? billProduct.remark :@"无" ];
[self isShowShippingQty:billProduct];
}
......
......@@ -274,20 +274,20 @@ typedef enum : NSUInteger {
if (_qpcQuantityField.text.length > 0) {//包装数量
//计算基础数量
float baseCount = [_qpcField.text floatValue] * [_qpcQuantityField.text floatValue];
_quantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
_quantityField.text = [NSString stringWithFormat:@"%.2f",baseCount];
}
}else if (textField == _qpcQuantityField) {//包装数量
if (_qpcField.text.length > 0) {//包装规格
//计算基础数量
float baseCount = [_qpcField.text floatValue] * [_qpcQuantityField.text floatValue];
_quantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
_quantityField.text = [NSString stringWithFormat:@"%.2f",baseCount];
}
}else if (textField == _quantityField) {//基础数量
if (_qpcField.text.length > 0) {//包装规格
//计算包装数量
if ([_qpcField.text integerValue] > 0) {
float packCount = [_quantityField.text floatValue] / [_qpcField.text floatValue];
_qpcQuantityField.text = [NSString stringWithFormat:@"%.0f",packCount];
_qpcQuantityField.text = [NSString stringWithFormat:@"%.2f",packCount];
}
}
}
......
......@@ -118,7 +118,7 @@ typedef enum : NSUInteger {
self.shopDetail.packageQpcUnit ? (_baseCountLabel.text = self.shopDetail.packageQpcUnit) : (_baseCountLabel.text = @"斤");
//包装数量
if ([self.shopDetail.packageQuantity integerValue] > 0) {
if ([self.shopDetail.packageQuantity floatValue] > 0) {
packageQuantity.text=self.shopDetail.packageQuantity;
}
//基础数量
......@@ -450,8 +450,8 @@ typedef enum : NSUInteger {
if (textField == packageSpecification || textField == packageQuantity) {
if (packageSpecification.text.length > 0 && packageQuantity.text.length > 0 ) {
//计算基础数量 和 总金额和包装单价
int baseCount = [packageSpecification.text intValue] * [packageQuantity.text intValue];
foundationQuantity.text = [NSString stringWithFormat:@"%d",baseCount];
float baseCount = [packageSpecification.text floatValue] * [packageQuantity.text floatValue];
foundationQuantity.text = [NSString stringWithFormat:@"%.2f",baseCount];
//如果基础单价有 会计算出包装单价和总价
//如果包装单价有 会计算出基础单价和总价
[self setTotalMoney];
......@@ -479,7 +479,7 @@ typedef enum : NSUInteger {
if (foundationQuantity.text.length > 0) {
float totalPrice = [foundationUnitPrice.text floatValue] * [foundationQuantity.text floatValue];
totalMoney.text = [NSString stringWithFormat:@"%.4f",totalPrice];
if (packageQuantity.text.length > 0 && [packageQuantity.text integerValue] > 0) {
if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) {
float packagePrice = totalPrice / [packageQuantity.text floatValue];
packageUnitPrice.text = [NSString stringWithFormat:@"%.4f",packagePrice];
}
......
......@@ -255,26 +255,26 @@
_choosePackUnitLabel.text = self.noticeProduct.unit;
_choosePackStandLabel.text = [NSString stringWithFormat:@"1*%@ %@",self.noticeProduct.qpc,self.noticeProduct.baseUnit];
_choosePackCountLabel.text = [NSString stringWithFormat:@"%@ %@",self.noticeProduct.qty,self.noticeProduct.unit];
_chooseBaseCountLabel.text = [NSString stringWithFormat:@"%@ %@",self.noticeProduct.baseQty,self.noticeProduct.baseUnit];
_chooseTotalLabel.text = [NSString stringWithFormat:@"%@元",self.noticeProduct.total];
_choosePackPriceLabel.text = [NSString stringWithFormat:@"%@ 元",self.noticeProduct.packprice];
_chooseBasePriceLabel.text = [NSString stringWithFormat:@"%@ 元",self.noticeProduct.price];
_choosePackStandLabel.text = [NSString stringWithFormat:@"1*%@ %@",[self.noticeProduct.qpc stringValue],self.noticeProduct.baseUnit];
_choosePackCountLabel.text = [NSString stringWithFormat:@"%@ %@",[self.noticeProduct.qty stringValue],self.noticeProduct.unit];
_chooseBaseCountLabel.text = [NSString stringWithFormat:@"%@ %@",[self.noticeProduct.baseQty stringValue],self.noticeProduct.baseUnit];
_chooseTotalLabel.text = [NSString stringWithFormat:@"%@元",[self.noticeProduct.total stringValue]];
_choosePackPriceLabel.text = [NSString stringWithFormat:@"%@ 元",[self.noticeProduct.packprice stringValue]];
_chooseBasePriceLabel.text = [NSString stringWithFormat:@"%@ 元",[self.noticeProduct.price stringValue]];
_shbzLabel.text = self.noticeProduct.unit;
_shjcLabel.text = self.noticeProduct.baseUnit;
if (self.noticeProduct.rctBaseQty) {
_shBaseQuantityField.text =[NSString stringWithFormat:@"%@",self.noticeProduct.rctBaseQty];
_shBaseQuantityField.text =[NSString stringWithFormat:@"%@",[self.noticeProduct.rctBaseQty stringValue]];
}
if (self.noticeProduct.rctQty) {
_shPackField.text =[NSString stringWithFormat:@"%@",self.noticeProduct.rctQty];
_shPackField.text =[NSString stringWithFormat:@"%@",[self.noticeProduct.rctQty stringValue]];
}
if (self.noticeProduct.rctTotal) {
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%@ 元",self.noticeProduct.rctTotal];
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%@ 元",[self.noticeProduct.rctTotal stringValue]];
}else {
_chooseTotalPriceLabel.text = @"0.00元";
_chooseTotalPriceLabel.text = @"0.0000元";
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
......@@ -295,7 +295,7 @@
}
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.4f元",total];
_shBaseQuantityField.text = [NSString stringWithFormat:@"%.0f",baseCount];
_shBaseQuantityField.text = [NSString stringWithFormat:@"%.2f",baseCount];
}
}else if (textField == _shBaseQuantityField) {
if (_shBaseQuantityField.text.length > 0) {
......@@ -306,7 +306,7 @@
}
_chooseTotalPriceLabel.text = [NSString stringWithFormat:@"%.4f元",total];
_shPackField.text = [NSString stringWithFormat:@"%.0f",baseCount];
_shPackField.text = [NSString stringWithFormat:@"%.2f",baseCount];
}
}
}
......
......@@ -161,24 +161,24 @@
{
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.titleLabel.text = transferProduct.productName;
self.dscountLabel.text = [NSString stringWithFormat:@"%@%@",transferProduct.qty,transferProduct.unit];
self.yscountLabel.text = [NSString stringWithFormat:@"%@%@",transferProduct.rctQty?transferProduct.rctQty:@"0",transferProduct.unit];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",transferProduct.qpc,transferProduct.baseUnit];
self.dscountLabel.text = [NSString stringWithFormat:@"%@%@",[transferProduct.qty stringValue],transferProduct.unit];
self.yscountLabel.text = [NSString stringWithFormat:@"%@%@",transferProduct.rctQty?[transferProduct.rctQty stringValue]:@"0",transferProduct.unit];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",[transferProduct.qpc stringValue],transferProduct.baseUnit];
self.showbzdwLabel.text = [NSString stringWithFormat:@"包装单位:%@",transferProduct.unit];
self.showbzCountLabel.text =[NSString stringWithFormat:@"包装数量:%@%@",transferProduct.qty,transferProduct.unit];
self.showshCountLabel.text =[NSString stringWithFormat:@"包装数量[实收]:%@%@",transferProduct.rctQty?(transferProduct.rctQty):@"0",transferProduct.unit];
self.showbzCountLabel.text =[NSString stringWithFormat:@"包装数量:%@%@",[transferProduct.qty stringValue],transferProduct.unit];
self.showshCountLabel.text =[NSString stringWithFormat:@"包装数量[实收]:%@%@",transferProduct.rctQty?([transferProduct.rctQty stringValue]):@"0",transferProduct.unit];
self.showjcCountLabel.text = [NSString stringWithFormat:@"基础数量:%@%@",transferProduct.baseQty,transferProduct.baseUnit];
self.showjcCountLabel.text = [NSString stringWithFormat:@"基础数量:%@%@",[transferProduct.baseQty stringValue],transferProduct.baseUnit];
self.showshjcCountLabel.text = [NSString stringWithFormat:@"基础数量[实收]:%@%@",transferProduct.rctBaseQty?transferProduct.rctBaseQty:@"0",transferProduct.baseUnit];
self.showshjcCountLabel.text = [NSString stringWithFormat:@"基础数量[实收]:%@%@",transferProduct.rctBaseQty?[transferProduct.rctBaseQty stringValue]:@"0",transferProduct.baseUnit];
self.showbzPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",transferProduct.packprice];
self.showjcPriceLabel.text = [NSString stringWithFormat:@"基础单价:%@元",transferProduct.price];
self.showbzPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",[transferProduct.packprice stringValue]];
self.showjcPriceLabel.text = [NSString stringWithFormat:@"基础单价:%@元",[transferProduct.price stringValue]];
self.showshTotalLabel.text = [NSString stringWithFormat:@"总金额[实收]:%@元",transferProduct.rctTotal?transferProduct.rctTotal:@"0"];
self.showshTotalLabel.text = [NSString stringWithFormat:@"总金额[实收]:%@元",transferProduct.rctTotal?[transferProduct.rctTotal stringValue]:@"0"];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",transferProduct.total?transferProduct.total:@"0"];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",transferProduct.total?[transferProduct.total stringValue]:@"0"];
self.showNoteLabel.text =[NSString stringWithFormat:@"备注:%@",transferProduct.note ? transferProduct.note :@"无" ];
if ([state isEqualToString:@"YES"]) {
if ([transferProduct.qty floatValue] > [transferProduct.rctQty floatValue]) {
......
......@@ -90,7 +90,6 @@
- (void)addChildView{
self.productVC = [[TransferProductViewController alloc]init];
// self.productVC.twoTitle = @"";
self.costVC = [[CostViewController alloc]init];
}
- (void)btnClick:(UIButton *)btn{
......@@ -130,8 +129,6 @@
- (void)refreshCost:(FeeAcountDetail *)fee indexPath:(NSIndexPath *)indexPath{
if (indexPath) {
[self.costVC.costArr replaceObjectAtIndex:indexPath.row withObject:fee];
// NSArray *indexArray=[NSArray arrayWithObject:indexPath];
// [self.costVC.tableView reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic];
[self.costVC.tableView reloadData];
}else{
if (self.costVC.costArr) {
......
......@@ -145,12 +145,12 @@
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.titleLabel.text = pdtDetail.productName;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[pdtDetail.price stringValue]];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",pdtDetail.qty,pdtDetail.unit];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",[pdtDetail.qty stringValue],pdtDetail.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",pdtDetail.productName,pdtDetail.productCode];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",pdtDetail.qpc,pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",pdtDetail.qty,pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",pdtDetail.baseQty,pdtDetail.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",pdtDetail.packprice];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",[pdtDetail.qpc stringValue],pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",[pdtDetail.qty stringValue],pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",[pdtDetail.baseQty stringValue],pdtDetail.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",[pdtDetail.packprice stringValue]];
NSString *sourceT = @"";
if ([pdtDetail.sourcetype isEqualToString:@"none"]) {
sourceT = @"无";
......@@ -162,7 +162,7 @@
self.showPurchaseLabel.text = [NSString stringWithFormat:@"来源类型:%@",sourceT];
self.showSourceNumberLabel.text = [NSString stringWithFormat:@"来源单号:%@",pdtDetail.sourcebillnumber.length > 0 ?pdtDetail.sourcebillnumber : @"无"];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",pdtDetail.total];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",[pdtDetail.total stringValue]];
self.showNoteLabel.text =[NSString stringWithFormat:@"备注:%@",pdtDetail.note ? pdtDetail.note :@"无"];
}
......
......@@ -151,14 +151,14 @@
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.titleLabel.text = pdtDetail.productName;
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[pdtDetail.price stringValue]];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",pdtDetail.qty,pdtDetail.unit];
self.countLabel.text = [NSString stringWithFormat:@"%@%@",[pdtDetail.qty stringValue],pdtDetail.unit];
self.showNameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",pdtDetail.productName,pdtDetail.productCode];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",pdtDetail.qpc,pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",pdtDetail.qty,pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",pdtDetail.baseQty,pdtDetail.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",pdtDetail.packprice];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:1*%@%@",[pdtDetail.qpc stringValue],pdtDetail.baseUnit];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@%@",[pdtDetail.qty stringValue],pdtDetail.unit];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@%@",[pdtDetail.baseQty stringValue],pdtDetail.baseUnit];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@元",[pdtDetail.packprice stringValue]];
self.showPurchaseLabel.text = [NSString stringWithFormat:@"采购单号:%@",pdtDetail.purchasebillnumber.length > 0 ? pdtDetail.purchasebillnumber: @"无"];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",pdtDetail.total];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@元",[pdtDetail.total stringValue]];
self.showNoteLabel.text =[NSString stringWithFormat:@"备注:%@",pdtDetail.note ? pdtDetail.note :@"无"];
}
......
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