SalesSlipGoodsListModel.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // SalesSlipGoodsListModel.m
  3. // IBOSSmini
  4. //
  5. // Created by ssl on 2018/1/29.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "SalesSlipGoodsListModel.h"
  9. @implementation SalesSlipGoodsListModel
  10. -(void)ParseDic:(NSDictionary *)dic{
  11. if(dic!=nil){
  12. NSString *decimalPlacesStr=[dic objectForKey:@"DecimalPlaces"];
  13. if(decimalPlacesStr==nil){
  14. _decimalPlaces=@"0";
  15. }
  16. else{
  17. _decimalPlaces=decimalPlacesStr;
  18. }
  19. _salesDetailType= [[dic objectForKey:@"SalesDetailType"]integerValue];
  20. _detailId=[dic objectForKey:@"DetailID"];
  21. _salesId=[dic objectForKey:@"SalesID"];
  22. _salesNo=[dic objectForKey:@"SalesNo"];
  23. _onlyCode=[dic objectForKey:@"OnlyCode"];
  24. _salesDetailTypeName=[dic objectForKey:@"SalesDetailTypeName"];
  25. _code=[dic objectForKey:@"Code"];
  26. _brandName=[dic objectForKey:@"BrandName"];
  27. _deliveryQuantity = [NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"DeliveryQuantity"] doubleValue]];
  28. _outQuantity = [NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"OutQuantity"] doubleValue]];
  29. _returnQuantity = [NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ReturnQuantity"] doubleValue]];
  30. _kindName=[dic objectForKey:@"KindName"];
  31. _factOrderQuantity=[[dic objectForKey:@"SalesQuantity"]doubleValue];
  32. int boxValue= [[dic objectForKey:@"Box"]intValue];
  33. _box=[NSString stringWithFormat:@"%d",boxValue];
  34. int pieceValue= [[dic objectForKey:@"Piece"]intValue];
  35. _piece=[NSString stringWithFormat:@"%d",pieceValue];
  36. _unitName=[dic objectForKey:@"UnitName"];
  37. _specification=[dic objectForKey:@"Specification"];
  38. _warehouseCode=[dic objectForKey:@"WarehouseCode"];
  39. _warehouseName=[dic objectForKey:@"WarehouseName"];
  40. _positionNumber=[dic objectForKey:@"PositionNumber"];
  41. _gradeName=[dic objectForKey:@"GradeName"];
  42. _colorNumber=[dic objectForKey:@"ColorNumber"];
  43. _factToSalesQuantity=[[dic objectForKey:@"FactToSalesQuantity"]doubleValue];
  44. _factOccupyQuantity=[[dic objectForKey:@"FactOccupyQuantity"]doubleValue];
  45. _circulateType=[dic objectForKey:@"CirculateType"];
  46. _goodsCirculateTypeName=[dic objectForKey:@"GoodsCirculateTypeName"];
  47. int package= [[dic objectForKey:@"Package"]intValue];
  48. _package=[NSString stringWithFormat:@"%d",package];
  49. double acreageValue=[[dic objectForKey:@"Acreage"]doubleValue];
  50. _acreage= [NSString stringWithFormat:@"%.6f",acreageValue];
  51. double volumeValue=[[dic objectForKey:@"Volume"]doubleValue];
  52. _volume= [NSString stringWithFormat:@"%.6f",volumeValue];
  53. double markedPriceValue= [[dic objectForKey:@"MarkedPrice"]doubleValue];
  54. _markedPrice=[NSString stringWithFormat:@"%.6f",markedPriceValue];
  55. double discountValue= [[dic objectForKey:@"Discount"]doubleValue];
  56. _discount=[NSString stringWithFormat:@"%.2f%@",discountValue,@"%"];
  57. _usePositionName=[dic objectForKey:@"UsePositionName"];
  58. _varietyName=[dic objectForKey:@"VarietyName"];
  59. _seriesName=[dic objectForKey:@"SeriesName"];
  60. _goodsName=[dic objectForKey:@"GoodsName"];
  61. _expandAttribute=[dic objectForKey:@"ExpandAttribute"];
  62. _expandAttribute2=[dic objectForKey:@"ExpandAttribute2"];
  63. _goodsRemarks=[dic objectForKey:@"CodeRemarks"];
  64. _remarks=[dic objectForKey:@"Remarks"];
  65. _supplier=[dic objectForKey:@"SupplierName"];
  66. _weight = [NSString stringWithFormat:@"%.6f",[[dic objectForKey:@"Weight"] doubleValue]];
  67. double m2Value= [[dic objectForKey:@"M2"]doubleValue];
  68. _M2=[NSString stringWithFormat:@"%.6f",m2Value];
  69. double m3Value=[[dic objectForKey:@"M3"]doubleValue];
  70. _M3=[NSString stringWithFormat:@"%.6f",m3Value];
  71. double orderPriceValue= [[dic objectForKey:@"SalesPrice"]doubleValue];
  72. _orderPrice=[NSString stringWithFormat:@"%.4f",orderPriceValue] ;
  73. _salesAmount=[NSString stringWithFormat:@"%.4f", [[dic objectForKey:@"SalesPrice"]doubleValue]*[[dic objectForKey:@"SalesQuantity"]doubleValue]] ;
  74. }
  75. }
  76. @end