generateAndSaveXml method

Future<String?> generateAndSaveXml(
  1. String fileName
)

Generates the XML file for the credit note and saves it to a file.

This method is used to generate the XML representation of the credit note and save it to a file with the given fileName. If the supplier information is missing, an exception will be thrown.

Returns the file path where the XML is saved or null if the file could not be saved.

Implementation

Future<String?> generateAndSaveXml(String fileName) async {
  // if (supplier != null) {
  //   return null;
  // }
  return await saveToFile(toXml(), fileName);
}