OrderSaleTotalModel.m 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // OrderSaleListModel.m
  3. // IBOSSmini
  4. //
  5. // Created by apple on 16/10/8.
  6. // Copyright © 2016年 elongtian. All rights reserved.
  7. //
  8. #import "OrderSaleTotalModel.h"
  9. @implementation OrderSaleTotalModel
  10. + (instancetype) orderSaleWithDict: (NSDictionary *)dic{
  11. OrderSaleTotalModel *model = [[self alloc]init];
  12. //[model setValuesForKeysWithDictionary:dict];
  13. if(dic!=nil){
  14. model.goodsAmount=[dic objectForKey:@"GoodsAmount"]==nil?@"0.00"
  15. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsAmount"] floatValue]];
  16. // ---舍零金额
  17. model.discountAmount= [dic objectForKey:@"DiscountAmount"]==nil?@"0.00"
  18. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"DiscountAmount"] floatValue]];
  19. // ----合计金额
  20. model.totalAmount=[dic objectForKey:@"TotalAmount"]==nil?@"0.00"
  21. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"TotalAmount"] floatValue]];
  22. // ----应收金额
  23. model.accountReceivableAmount=[dic objectForKey:@"AccountReceivableAmount"]==nil?@"0.00"
  24. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"AccountReceivableAmount"] floatValue]];
  25. // ----转销售金额
  26. model.toSalesAmount=[dic objectForKey:@"ToSalesAmount"]==nil?@"0.00"
  27. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ToSalesAmount"] floatValue]];
  28. // ----未转销售金额
  29. // model.UnToSalesAmount=[dic objectForKey:@"UnToSalesAmount"];
  30. // ----实际转销售金额
  31. model.toFactSalesAmount=[dic objectForKey:@"ToFactSalesAmount"]==nil?@"0.00"
  32. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ToFactSalesAmount"] floatValue]];
  33. // ---使用定金金额
  34. model.useEarnestAmount=[dic objectForKey:@"UseEarnestAmount"]==nil?@"0.00"
  35. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"UseEarnestAmount"] floatValue]];
  36. // ----总定金
  37. model.totalEarnestAmount=[dic objectForKey:@"TotalEarnestAmount"]==nil?@"0.00"
  38. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"TotalEarnestAmount"] floatValue]];
  39. // ----应收款收款金额
  40. model.receivableSum =[dic objectForKey:@"ReceivableSum"]==nil?@"0.00"
  41. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ReceivableSum"] floatValue]]; }
  42. return model;
  43. }
  44. - (void)setValue:(id)value forKey:(NSString *)key{
  45. // if ([key isEqualToString:@"id"]) {
  46. // _MyID = value;
  47. // }
  48. }
  49. - (void)setValue:(id)value forUndefinedKey:(NSString *)key{
  50. NSLog(@"------%@",key);
  51. }
  52. @end