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 function permanentlyRemoveById (id) { | |
| return Todo.remove({ _id: id}) | |
| } | |
| export function removeById (id) { | |
| return Todo.findByIdAndUpdate(id, { deleted: true }) | |
| } | |
| export function isRoles (role, compareRoles) { | |
| return roles.indexOf(role) >= 0 |
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
| public class Receipt { | |
| public DateTime Timestamp; | |
| public string ReceiptNo; | |
| public List<LineItem> Items; | |
| public decimal CalculateSubTotal() { | |
| return Items.sum(d => d.price); | |
| } | |
| } |
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
| public class PurchaseOrder extends Receipt { | |
| public void PrintAndSendEmail(string toMail); | |
| } |
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
| public class PurchaseOrder extends Receipt { | |
| public void PrintAndSendEmail(string toMail); | |
| public override decimal CalculateSubTotal() { | |
| return super() * 1.07; | |
| } | |
| } |
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
| public class Invoice { | |
| private bool isForXDepartment; | |
| private bool isForYDepartment; | |
| private bool isCalculateVat; | |
| private bool isCalculateSpecialTax; | |
| private double departmentYBudgetRatio; | |
| private List<InvoiceItem> items; | |
| public class InvoiceItem { |
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
| public class Invoice { | |
| private bool isForXDepartment; | |
| public Invoice(bool isForXDepartment) { | |
| // บริษัทนี้ถ้าเป็นใบเสร็จของแผนก X จะต้องคำนวณภาษีและส่วนลดแบบพิเศษ | |
| this.isForXDepartment = isForXDepartment; | |
| } | |
| public double calculateSumPrice () { | |
| if (this.isForXDepartment) { |
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
| public class InvoiceDepartmentX { | |
| private bool isForXDepartment; // ไม่จำเป็น เพราะเป็น X เสมอ | |
| private bool isForYDepartment; // ไม่จำเป็น เพราะเป็น X เสมอ | |
| private bool isCalculateVat; | |
| private bool isCalculateSpecialTax; | |
| private double departmentYBudgetRatio; | |
| private List<InvoiceItem> items; | |
| public class InvoiceItem { |
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
| public class InvoiceDepartmentX { | |
| private List<InvoiceItem> items; | |
| public class InvoiceItem { | |
| public int quantity; | |
| public string description; | |
| public double pricePerUnit; | |
| } |
OlderNewer