OrderSaleListModel.m 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "OrderSaleListModel.h"
  9. @implementation OrderSaleListModel
  10. + (instancetype) orderSaleDetailWithDict: (NSDictionary *)dic{
  11. OrderSaleListModel *model = [[self alloc]init];
  12. //[model setValuesForKeysWithDictionary:dict];
  13. if(dic!=nil){
  14. model.invoiceId=[dic objectForKey:@"InvoiceID"] ;
  15. model.invoiceNo=[dic objectForKey:@"InvoiceNo"] ;//单号
  16. model.customerName=[dic objectForKey:@"CustomerName"] ;//客户名称
  17. model.customerCode=[dic objectForKey:@"CustomerCode"] ;//客户
  18. model.organizationName=[dic objectForKey:@"OrganizationName"];
  19. model.staffName=[dic objectForKey:@"StaffName"];
  20. model.contacts=[dic objectForKey:@"Contacts"] ;//联系人
  21. model.telephone=[dic objectForKey:@"Telephone"] ;//客户电话
  22. model.accountDate=[dic objectForKey:@"AccountDate"] ;//日期
  23. model.invoiceType=[dic objectForKey:@"InvoiceType"] ;//单据类型 (0、全部 1、订单,2、销售单)
  24. model.invoiceTypeName=[dic objectForKey:@"InvoicesTypeName"] ;
  25. model.orderSalesType=[dic objectForKey:@"OrderSalesType"] ;//业务类型
  26. model.orderSalesTypeName=[dic objectForKey:@"OrderSalesTypeName"] ;
  27. model.goodsAmount=[dic objectForKey:@"GoodsAmount"]==nil?@"0.00"
  28. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"GoodsAmount"] floatValue]];
  29. // ---舍零金额
  30. model.discountAmount=[dic objectForKey:@"DiscountAmount"]==nil?@"0.00"
  31. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"DiscountAmount"] floatValue]];
  32. // ---标价总额
  33. model.markedPriceAmount=[dic objectForKey:@"MarkedPriceAmount"]==nil?@"0.00"
  34. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"MarkedPriceAmount"] floatValue]];
  35. // ---费用金额
  36. model.feesAmount=[dic objectForKey:@"FeeAmount"]==nil?@"0.00"
  37. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"FeeAmount"] floatValue]];
  38. // ---剩余定金金额
  39. //model.EarnestAmount=[dic objectForKey:@"EarnestAmount"];
  40. // ---使用预收金额
  41. model.depositReceivedAmount=[dic objectForKey:@"DepositReceivedAmount"]==nil?@"0.00"
  42. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"DepositReceivedAmount"] floatValue]];
  43. // ----收款金额
  44. model.receivableAmount=[dic objectForKey:@"ReceivableAmount"]==nil?@"0.00"
  45. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ReceivableAmount"] floatValue]];
  46. // ----合计金额
  47. model.totalAmount=[dic objectForKey:@"TotalAmount"]==nil?@"0.00"
  48. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"TotalAmount"] floatValue]];
  49. // ----应收金额
  50. model.accountReceivableAmount=[dic objectForKey:@"AccountReceivableAmount"]==nil?@"0.00"
  51. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"AccountReceivableAmount"] floatValue]];
  52. // ----转销售金额
  53. model.toSalesAmount=[dic objectForKey:@"ToSalesAmount"]==nil?@"0.00"
  54. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ToSalesAmount"] floatValue]];
  55. // ----未转销售金额
  56. // model.UnToSalesAmount=[dic objectForKey:@"UnToSalesAmount"];
  57. // ----实际转销售金额
  58. model.toFactSalesAmount=[dic objectForKey:@"ToFactSalesAmount"]==nil?@"0.00"
  59. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ToFactSalesAmount"] floatValue]];
  60. // ---使用定金金额
  61. model.useEarnestAmount=[dic objectForKey:@"UseEarnestAmount"]==nil?@"0.00"
  62. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"UseEarnestAmount"] floatValue]];
  63. // ----总定金
  64. model.totalEarnestAmount=[dic objectForKey:@"TotalEarnestAmount"]==nil?@"0.00"
  65. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"TotalEarnestAmount"] floatValue]];
  66. // ----应收款收款金额
  67. model.receivableSum =[dic objectForKey:@"ReceivableSum"]==nil?@"0.00"
  68. :[NSString stringWithFormat:@"%.2f",[[dic objectForKey:@"ReceivableSum"] floatValue]];
  69. }
  70. return model;
  71. }
  72. @end