Equipment Leasing Creation

Purpose
The Equipment Lease Maintenance screen allows a user to enter a new Equipment Lease or edit an existing note. This document will focus on the former, Equipment Lease Creation.

Process
Prior to an Equipment Lease being setup in the system the user must first make sure that the Country/Currency combination for that store has General Ledger accounts for both the Equipment Lease Monthly Charge and Equipment Lease Monthly Charge Taxes. The store must also be setup for EFT for the Royalty balance type.


 * 1) The user would choose which taxes to apply to this lease. The sum of these records make up the Tax Rate.
 * 2) The user would then enter the number of Monthly Payments, Non Tax Assets, Tax Assets. Based off these numbers the following numbers can be calculated:
 * 3) Rate -- is defined as 2.7 for 60 month leases or 3.85 for 36 month leases
 * 4) Net Payment -- (Non Tax Assets+Tax Assets) * Rate / 100.0
 * 5) Tax Amount -- Tax Assets * Tax Rate, unless the store is in a state that has a Tax Exception.
 * 6) Gross Payment -- Net Payment + Tax Amount
 * 7) Upon Save each of the properties of the Equipment Lease object are set
 * 8) The EFT properties are set from the EFT setting of either the Royalty Balance Type or the EFT Pre-note object of the base store
 * 9) The Adjustment Amount and Eft Amount for this new EFT object are set to zero.
 * 10) The values for the Document Tracking properties are set
 * 11) A new Account Balance record is set up.
 * 12) The EntityType is set to Equipment Lease
 * 13) The EntityId is equal to the Lease Number
 * 14) All taxes the user assigned in the first step get added to the TaxAssignedCollection object
 * 15) If all the information above is valid
 * 16) All information is saved to the database
 * 17) The cache is set to the current lease
 * 18) The form is reinitialized
 * 19) If the Equipment Lease object is not valid, an error provider stating what needs to be corrected is shown to the user.

Validations

 * 1) The only possible Entity Type is Store. From the front-end form the user does not get an option to change this.
 * 2) Entity Id must be greater than 0 and
 * 3) Lease Status must be a valid Status Type. From the front-end form an invalid option cannot be chosen.
 * 4) Number of Payments can only be 36 or 60 months
 * 5) The store cannot be an Inactive Transfer
 * 6) Lease can only be switch to Written-Off if the previous Lease State was Finalized
 * 7) A General Ledger Account must be set up for the current Entity Type, Country and Currency combination for a type of EL Monthly Charges
 * 8) A General Ledger Account must be set up for the current Entity Type, Country and Currency combination for a type of Monthly Charge Taxes
 * 9) A Lease cannot be set to cancelled if payments billed, number of invoices, or number of cash receipts are greater than 0

Stored Procedure
Equipment Lease Maintenance uses the following procedures: