toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final map = <String, dynamic>{};
  if (reference != null) map['reference'] = reference;
  if (resolution != null) map['resolution'] = resolution?.toMap();
  if (date != null) map['date'] = date;
  if (hour != null) map['hour'] = hour;
  if (customer != null) map['customer'] = customer?.toMap();
  if (establishment != null) map['establishment'] = establishment?.toMap();
  if (paymentMeans != null) map['paymentMeans'] = paymentMeans;
  if (paymentPrepaid != null) map['paymentPrepaid'] = paymentPrepaid;
  if (charges != null) map['charges'] = charges!.map((charge) => charge.toMap()).toList();
  if (retentions != null) map['retentions'] = retentions;
  if (items != null) map['items'] = items!.map((item) => item.toApi()).toList();
  if (taxes != null) map['taxes'] = taxes!.map((tax) => tax.toApi()).toList();
  if (totals != null) map['totals'] = totals;
  if (sellerName != null) map['sellerName'] = sellerName;
  if (website != null) map['website'] = website;
  if (sendmail != null) map['sendmail'] = sendmail;
  if (sendmailtome != null) map['sendmailtome'] = sendmailtome;
  if (notes != null) map['notes'] = notes;
  if (noteHead != null) map['noteHead'] = noteHead;
  if (noteFoot != null) map['noteFoot'] = noteFoot;
  if (delivery != null) map['delivery'] = delivery;
  if (paymentsPse != null) map['paymentsPse'] = paymentsPse;
  //if (id != null) map['id'] = id;
  //if (dateId != null) map['dateId'] = dateId;

  if (state != null) map['state'] = state;
  if (stateOrder != null) map['stateOrder'] = stateOrder;
  if (cufe != null) map['cufe'] = cufe;
  if (payments != null) map['payments'] = payments;
  return map;
}