QuickbooksDiscountLineDetails.fromMap constructor

QuickbooksDiscountLineDetails.fromMap(
  1. Map<String, dynamic> map
)

Converts from a map value

Implementation

factory QuickbooksDiscountLineDetails.fromMap(Map<String, dynamic> map) {
  return QuickbooksDiscountLineDetails(
      classRef: map['ClassRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['ClassRef'] as Map<String, dynamic>)
          : null,
      taxCodeRef: map['TaxCodeRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['TaxCodeRef'] as Map<String, dynamic>)
          : null,
      discountAccountRef: map['DiscountAccountRef'] != null
          ? QuickbooksReferenceType.fromMap(
              map['DiscountAccountRef'] as Map<String, dynamic>)
          : null,
      percentBased: map['PercentBased'],
      discountPercent: double.tryParse(map['DiscountPercent'].toString()));
}