Created
March 22, 2025 11:21
-
-
Save trikitrok/a604e30b527224a4e4641e25a9ead4f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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