OrderSaleListDetailModel.m 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // OrderSaleListDetailModel.m
  3. // IBOSSmini
  4. //
  5. // Created by apple on 16/10/10.
  6. // Copyright © 2016年 elongtian. All rights reserved.
  7. //
  8. #import "OrderSaleListDetailModel.h"
  9. @implementation OrderSaleListDetailModel
  10. + (instancetype) orderSaleDetailWithDict: (NSDictionary *)dic{
  11. OrderSaleListDetailModel *model = [[self alloc]init];
  12. if(dic!=nil){
  13. NSInteger invoiceIdValue = [[dic objectForKey:@"InvoiceID"] integerValue];
  14. model.invoiceID= [NSString stringWithFormat:@"%ld",(long)invoiceIdValue] ;
  15. model.detailInvoiceNo=[dic objectForKey:@"DetailInvoiceNo"] ;
  16. model.accountDate=[dic objectForKey:@"AccountDate"] ;//日期
  17. model.invoiceType=[dic objectForKey:@"InvoiceType"] ;//单据类型 (0、全部 1、订单,2、销售单)
  18. model.invoiceTypeName=[dic objectForKey:@"InvoiceTypeName"] ;
  19. model.orderSalesType=[dic objectForKey:@"OrderSalesType"] ;//业务类型
  20. model.orderSalesTypeName=[dic objectForKey:@"OrderSalesTypeName"] ;
  21. model.salesDetailType=[dic objectForKey:@"SalesDetailType"] ;//业务类型
  22. model.salesDetailTypeName=[dic objectForKey:@"SalesDetailTypeName"] ;
  23. model.onlyCode=[dic objectForKey:@"OnlyCode"];
  24. model.code=[dic objectForKey:@"Code"] ;
  25. model.brandName=[dic objectForKey:@"BrandName"] ;//品牌
  26. model.kindName=[dic objectForKey:@"KindName"] ;//品种
  27. model.varietyName=[dic objectForKey:@"VarietyName"] ;
  28. model.seriesName=[dic objectForKey:@"SeriesName"] ;
  29. model.unitName=[dic objectForKey:@"UnitName"] ;
  30. model.specification=[dic objectForKey:@"Specification"] ;
  31. model.gradeName=[dic objectForKey:@"GradeName"] ;
  32. model.colorNumber=[dic objectForKey:@"ColorNumber"] ;
  33. float orderQuantityValue= [[dic objectForKey:@"OrderQuantity"]floatValue];
  34. model.orderQuantity= [NSString stringWithFormat:@"%lf", orderQuantityValue];
  35. float salesQuantityValue= [[dic objectForKey:@"SalesQuantity"]floatValue];
  36. model.salesQuantity=[NSString stringWithFormat:@"%lf",salesQuantityValue] ;
  37. model.salesPrice=[dic objectForKey:@"SalesPrice"]==nil?@"0.00"
  38. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"SalesPrice"] floatValue]];
  39. model.goodsSettlementPrice=[dic objectForKey:@"GoodsSettlementPrice"]==nil?@"0.00"
  40. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsSettlementPrice"] floatValue]];
  41. model.goodsSettlementAmount=[dic objectForKey:@"GoodsSettlementAmount"]==nil?@"0.00"
  42. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsSettlementAmount"] floatValue]];
  43. model.goodsSettlementPrice2=[dic objectForKey:@"GoodsSettlementPrice2"]==nil?@"0.00"
  44. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsSettlementPrice2"] floatValue]];
  45. model.goodsSettlementAmount2=[dic objectForKey:@"GoodsSettlementAmount2"]==nil?@"0.00"
  46. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsSettlementAmount2"] floatValue]];
  47. model.markedPrice=[dic objectForKey:@"MarkedPrice"]==nil?@"0.00"
  48. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"MarkedPrice"] floatValue]];
  49. model.amount=[dic objectForKey:@"Amount"]==nil?@"0.00"
  50. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"Amount"] floatValue]];
  51. float discountValue = [[dic objectForKey:@"Discount"]floatValue];
  52. model.discount=[NSString stringWithFormat:@"%.2f",discountValue] ;
  53. }
  54. return model;
  55. }
  56. @end