Invoice Class This abstract class contains functionality that supports the business process of creating an invoice. Create the Invoice class in the Library project. This
Invoice Class
This abstract class contains functionality that supports the business process of creating an invoice.
Create the Invoice class in the Library project. This class must be defined under the my.Business namespace.
Fields
provincialSalesTaxRate : decimal - The provincial sales tax rate applied to the invoice.
goodsAndServicesTaxRate : decimal - The goods and services tax rate applied to the invoice.
Properties
ProvincialSalesTaxRate : decimal
Gets and sets the provincial sales tax rate.
Exceptions:
- ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
- ArgumentOutOfRangeException - When the property is set to greater than 1. Message: The value cannot be greater than 1. Parameter name: "value".
GoodsAndServicesTaxRate : decimal
Gets and sets the goods and services tax rate.
Exceptions:
- ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
- ArgumentOutOfRangeException - When the property is set to greater than 1. Message: The value cannot be greater than 1. Parameter name: "value".
ProvincialSalesTaxCharged : decimal (Abstract)
Gets the amount of provincial sales tax charged to the customer.
GoodsAndServicesTaxCharged : decimal (Abstract)
Gets the amount of goods and services tax charged to the customer.
SubTotal : decimal (Abstract)
Gets the subtotal of the Invoice.
Total : decimal
Gets the total of the Invoice (Subtotal + Taxes).
Methods
Invoice(decimal, decimal)
Initializes an instance of Invoice with a provincial and goods and services tax rates.
Parameters:
- provincialSalesTaxRate - The rate of provincial tax charged to a customer.
- goodsAndServicesTaxRate - The rate of goods and services tax charged to a customer.
Exceptions:
- ArgumentOutOfRangeException - When the provincial sales tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "provincialSalesTaxRate".
- ArgumentOutOfRangeException - When the provincial sales tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "provincialSalesTaxRate".
- ArgumentOutOfRangeException - When the goods and services tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "goodsAndServicesTaxRate".
- ArgumentOutOfRangeException - When the goods and services tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "goodsAndServicesTaxRate".
Sales Quote -vehicle Sale Price: decimal -tradelnAmount: decimal -sales Tax Rate : decimal -accessoriesChosen : Accessories -exteriorFinishChosen : ExteriorFinish > +VehicleSale Price : decimal > +TradeInAmount: decimal > +AccessoriesChosen : Accessories > +Exterior FinishChosen : ExteriorFinish > > +Accessory Cost: decimal > > +FinishCost: decimal > > +SubTotal: decimal > > +SalesTax : decimal > > +Total : decimal > > +AmountDue : decimal +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal, accessoriesChosen : Accessories, exterior FinishChosen : ExteriorFinish) +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal) > > V > ExteriorFinish > Accessories Invoice -provincialSalesTax Rate : decimal -goodsAndServices Tax Rate : decimal > + ProvincialSales Tax Rate : decimal > +GoodsAndServices Tax Rate : decimal |> > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServices TaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Invoice(provincial Sales TaxRate : decimal, goodsAndServicesTax Rate : decimal) The ProvincialSalesTaxChanged, GoodsAndServices Tax Charged, and SubTotal properties are all abstract. This diagramming tool can not represent properties as abstract. > Cost Type Labour Part Material Servicelnvoice > > +LabourCost : decimal > > +Parts Cost : decimal > > +MaterialCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Servicelnvoice(provincialTax Rate : decimal, goodsAndServices Tax Rate : decimal) +AddCost(type: Cost Type, amount : decimal) CarWashinvoice -packageCost : decimal -fragranceCost : decimal > +PackageCost : decimal > +FragranceCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +CarWashInvoice(provincialSales TaxRate : decimal, goodsAndServices TaxRate : decimal) +CarWashInvoice provincialSales TaxRate: decimal, goodsAndService TaxRate : decimal, packageCost: decimal, fragranceCost : decimal) > > Financial +GetPayment(rate : decimal, numberOfPaymentPeriods : int, present Value: decimal) Sales Quote -vehicle Sale Price: decimal -tradelnAmount: decimal -sales Tax Rate : decimal -accessoriesChosen : Accessories -exteriorFinishChosen : ExteriorFinish > +VehicleSale Price : decimal > +TradeInAmount: decimal > +AccessoriesChosen : Accessories > +Exterior FinishChosen : ExteriorFinish > > +Accessory Cost: decimal > > +FinishCost: decimal > > +SubTotal: decimal > > +SalesTax : decimal > > +Total : decimal > > +AmountDue : decimal +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal, accessoriesChosen : Accessories, exterior FinishChosen : ExteriorFinish) +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal) > > V > ExteriorFinish > Accessories Invoice -provincialSalesTax Rate : decimal -goodsAndServices Tax Rate : decimal > + ProvincialSales Tax Rate : decimal > +GoodsAndServices Tax Rate : decimal |> > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServices TaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Invoice(provincial Sales TaxRate : decimal, goodsAndServicesTax Rate : decimal) The ProvincialSalesTaxChanged, GoodsAndServices Tax Charged, and SubTotal properties are all abstract. This diagramming tool can not represent properties as abstract. > Cost Type Labour Part Material Servicelnvoice > > +LabourCost : decimal > > +Parts Cost : decimal > > +MaterialCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Servicelnvoice(provincialTax Rate : decimal, goodsAndServices Tax Rate : decimal) +AddCost(type: Cost Type, amount : decimal) CarWashinvoice -packageCost : decimal -fragranceCost : decimal > +PackageCost : decimal > +FragranceCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +CarWashInvoice(provincialSales TaxRate : decimal, goodsAndServices TaxRate : decimal) +CarWashInvoice provincialSales TaxRate: decimal, goodsAndService TaxRate : decimal, packageCost: decimal, fragranceCost : decimal) > > Financial +GetPayment(rate : decimal, numberOfPaymentPeriods : int, present Value: decimal)