Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created March 22, 2025 11:21
Show Gist options
  • Save trikitrok/a604e30b527224a4e4641e25a9ead4f9 to your computer and use it in GitHub Desktop.
Save trikitrok/a604e30b527224a4e4641e25a9ead4f9 to your computer and use it in GitHub Desktop.
export class Invoice {
//...
public getValue(): Money {
const total = this.itemsSum();
if (this.billingDate.after(OurDate.yearEnd(this.openingDate))) {
if (
this.originator.getState() === "FL" ||
this.originator.getState() === "NY"
) {
total.add(this.getLocalShipping());
} else {
total.add(this.getDefaultShipping());
}
} else {
total.add(this.getSpanningShipping());
}
total.add(this.getTax());
return total;
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment