SalesSlipListModel.m 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // SalesSlipListModel.m
  3. // IBOSSmini
  4. //
  5. // Created by ssl on 2018/1/29.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "SalesSlipListModel.h"
  9. #import "DateFormat.h"
  10. @implementation SalesSlipListModel
  11. -(void)ParseDic:(NSDictionary *)dic
  12. {
  13. if(dic!=nil){
  14. _status = [[dic objectForKey:@"Status"]integerValue];
  15. _invoiceStatusName= [dic objectForKey:@"InvoiceStatusName"];
  16. _customerName=[dic objectForKey:@"CustomerName"];
  17. _contractNumber=[dic objectForKey:@"ContractNumber"];
  18. double toSalesAmountValue=[[dic objectForKey:@"ToSalesAmount"]doubleValue ];
  19. _toSalesAmount=[NSString stringWithFormat:@"%.4f",toSalesAmountValue];
  20. double markedPriceAmountValue=[[dic objectForKey:@"MarkedPriceAmount"]doubleValue];
  21. _markedPriceAmount=[NSString stringWithFormat:@"%.4f",markedPriceAmountValue];
  22. _otherContact=[dic objectForKey:@"OtherContact"];
  23. _intermediateCustomersName=[dic objectForKey:@"IntermediateCustomersName"];
  24. _customerCode=[dic objectForKey:@"CustomerCode"];
  25. double totalAmountValue= [[dic objectForKey:@"TotalAmount"]doubleValue];
  26. _totalAmount=[NSString stringWithFormat:@"%.4f",totalAmountValue];
  27. int orderIdValue= [[dic objectForKey:@"SalesID"]intValue];
  28. _salesId=[NSString stringWithFormat:@"%d",orderIdValue];
  29. _channelName=[dic objectForKey:@"ChannelName"];
  30. _deliveryFlag= [[dic objectForKey:@"DeliveryFlag"]boolValue];
  31. _installationFlag=[[dic objectForKey:@"InstallationFlag"]boolValue];
  32. NSString *estimateDeliveryDateStr= [dic objectForKey:@"EstimateDeliveryDate"];
  33. _estimateDeliveryDate=[DateFormat dateFormatSplit:estimateDeliveryDateStr];
  34. _estimateInstallationDate=[DateFormat dateFormatSplit: [dic objectForKey:@"EstimateInstallationDate"]];
  35. _deliveryAreaName=[dic objectForKey:@"DeliveryAreaName"];
  36. _floorsName=[dic objectForKey:@"FloorsName"];
  37. _setReversedOrderNo=[dic objectForKey:@"ReversedSalesNo"];
  38. _createUser=[dic objectForKey:@"CreateUser"];
  39. _updateUser=[dic objectForKey:@"UpdateUser"];
  40. _createTime=[DateFormat dateFormatSplit:[dic objectForKey:@"CreateTime"]];
  41. _updateTime=[DateFormat dateFormatSplit:[dic objectForKey:@"UpdateTime"]];
  42. _remarks=[dic objectForKey:@"Remarks"];
  43. _weight=[[dic objectForKey:@"Weight"] stringValue];
  44. double totalVolumeValue=[[dic objectForKey:@"TotalVolume"]doubleValue];
  45. _totalVolume=[NSString stringWithFormat:@"%.6f",totalVolumeValue];
  46. _contacts=[dic objectForKey:@"Contacts"];
  47. _salesTypeName=[dic objectForKey:@"SalesTypeName"];
  48. _salesType=[[dic objectForKey:@"SalesType"]integerValue];
  49. _telephone=[dic objectForKey:@"Telephone"];
  50. _customerTypeName=[dic objectForKey:@"CustomerTypeName"];
  51. _SalesNo=[dic objectForKey:@"SalesNo"];
  52. double orderEarnestSumValue=[[dic objectForKey:@"SalesEarnestSum"]doubleValue];
  53. _orderEarnestSum= [NSString stringWithFormat:@"%.4f",orderEarnestSumValue];
  54. _channelName=[dic objectForKey:@"ChannelName"];
  55. double goodsAmountValue=[[dic objectForKey:@"GoodsAmount"]doubleValue];
  56. _goodsAmount= [NSString stringWithFormat:@"%.2f",goodsAmountValue];
  57. int organizationIdValue=[[dic objectForKey:@"OrganizationID"]intValue];
  58. _organizationId=[NSString stringWithFormat:@"%d",organizationIdValue];
  59. int customerIdValue=[[dic objectForKey:@"CustomerID"]intValue];
  60. _customerId=[NSString stringWithFormat:@"%d",customerIdValue];
  61. double discountAmountValue=[[dic objectForKey:@"DiscountAmount"]doubleValue];
  62. _discountAmount=[NSString stringWithFormat:@"%.4f",discountAmountValue];
  63. //使用定金?
  64. double earnestAmountValue= [[dic objectForKey:@"EarnestAmount"]doubleValue];
  65. _earnestAmount=[NSString stringWithFormat:@"%.2f",earnestAmountValue];
  66. double totalEarnestAmountValue= [[dic objectForKey:@"TotalEarnestAmount"]doubleValue];
  67. _totalEarnestAmount= [NSString stringWithFormat:@"%.4f",totalEarnestAmountValue];
  68. double earnestRateValue= [[dic objectForKey:@"EarnestRate"]doubleValue];
  69. _earnestRate=[NSString stringWithFormat:@"%.2f,%@",earnestRateValue,@"%"];
  70. double totalEarnestRateValue=[[dic objectForKey:@"TotalEarnestRate"]doubleValue];
  71. _totalEarnestRate=[NSString stringWithFormat:@"%.2f,%@",totalEarnestRateValue,@"%"];
  72. double discountValue= [[dic objectForKey:@"Discount"]doubleValue];
  73. _discount=[NSString stringWithFormat:@"%.2f",discountValue];
  74. _goodsCount=[dic objectForKey:@"GoodsCount"]==nil?@"0":[dic objectForKey:@"GoodsCount"];
  75. _organizationName=[dic objectForKey:@"OrganizationName"];
  76. int staffIdValue= [[dic objectForKey:@"StaffID"]intValue];
  77. _staffId=[NSString stringWithFormat:@"%d",staffIdValue];
  78. _staffName=[dic objectForKey:@"StaffName"];
  79. _createUser=[dic objectForKey:@"CreateUser"];
  80. _accountDate=[DateFormat dateFormatSplit:[dic objectForKey:@"AccountDate"]];
  81. _address=[dic objectForKey:@"Address"];
  82. _depositReceivedAmount=[[dic objectForKey:@"DepositReceivedAmount"] stringValue];
  83. _amountCollected=[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ReceivableAmount"] doubleValue]];
  84. double finalReceivableValue =[[dic objectForKey:@"FinalReceivableAmount"]doubleValue];
  85. _finalReceivables=[NSString stringWithFormat:@"%.4f",finalReceivableValue];
  86. _originalNumber=[dic objectForKey:@"OriginalNumber"];
  87. _accountReceivableAmount=[[dic objectForKey:@"AccountReceivableAmount"] stringValue];
  88. _receivables =[dic objectForKey:@"ReceivablesTypeName"];
  89. _salesDetailType=[[dic objectForKey:@"SalesDetailType"] intValue];
  90. double receivablePayAmountValue=[[dic objectForKey:@"ReceivableSum"]doubleValue];
  91. _receivablePayAmount= [NSString stringWithFormat:@"%.4f",receivablePayAmountValue];
  92. double verificationSumValue=[[dic objectForKey:@"VerificationSum"]doubleValue];
  93. _verificationSum=[NSString stringWithFormat:@"%.4f",verificationSumValue];
  94. double finalReceivableAmountValue=[[dic objectForKey:@"FinalReceivableAmount"]doubleValue];
  95. _finalReceivableAmount=[NSString stringWithFormat:@"%.4f",finalReceivableAmountValue];
  96. }
  97. }
  98. @end