split static method

GstResult split({
  1. required double totalTax,
  2. required bool intraState,
})

Splits a total tax amount into CGST, SGST, or IGST based on intra/inter state.

Implementation

static GstResult split({
  required double totalTax,
  required bool intraState,
}) {
  if (intraState) {
    return GstResult(
      cgst: totalTax / 2,
      sgst: totalTax / 2,
      igst: 0,
      totalTax: totalTax,
    );
  } else {
    return GstResult(
      cgst: 0,
      sgst: 0,
      igst: totalTax,
      totalTax: totalTax,
    );
  }
}