Charge and estimate minimum quantities

Donate to this project

Development Project Status: Completed

Total cost estimate (ex-Tax): 
$1390
Due date for completion of this stage: 
11/05/2016
Release: 
1.9
Current Percentage Funded: 
100.00%
Project funding: 

You can donate money to this project by entering the amount above and clicking the 'Add to cart' button. In the Checkout process you can either choose to pay now (via Bank Transfer, Cheque or Pay Pal) or you can pledge the amount by choosing the 'Pledge a payment for a Development Project' method. If you make a pledge, then when we have 100% funding commitments, you will be notified by email and you can then action your payment. Note that development will not commence until all funds are received.

Project description: 

This project will provide a practice-level option to restrict editing of charge or estimate item quantities, so that they don't fall below a set minimum.
This will reduce invoicing errors.

Charge Minimum Quantity

For Invoices, Counter Sales, and Credits, the low quantity of an item generated from an estimate or template will be stored in a new hidden Minimum Quantity field on the item.

The charge quantity will not be permitted to be set below this value. Doing so will trigger a validation error e.g.:

The Quantity cannot be set below the minimum quantity of 1

When a charge item has a non-zero minimum quantity set, a warning will be displayed when deleting it e.g.:

       Carprofen Tablets 20mg has a minimum quantity of 3.
       Are you sure you want to delete it?

Estimate Minimum Quantity

The low quantity of an item generated from a template will be stored in a new hidden Minimum Quantity field on the estimate item.

The estimate item low quantity will not be permitted to be set below this value. Doing so will trigger a validation error:

The Low Quantity cannot be set below the minimum quantity of X

When an estimate item has a non-zero minimum quantity set, a warning will be displayed when deleting it e.g.:

       Desex - Dog < 20kg has a minimum quantity of 1.
       Are you sure you want to delete it?

Invoicing Estimates

When an estimate is invoiced, an estimate item's Low Qty becomes the minimum quantity for the corresponding invoice item.

Changing Products

  • changing a Service product with a minimum quantity will not be permitted.
  • changing a Medication or Merchandise product with a minimum quantity to another product will be permitted, so long as the new product is of the same type (i.e. Medication/Merchandise). The minimum quantity will be retained. This is to support instances where the preferred product is out of stock.

Configuration

The minimum quantity restriction will be enabled by a new option on the Practice, Minimum Quantities.

By default, it is not selected.

Migration

There will be no migration required for this project.

Existing charges and estimates will have no minimum quantity restriction.

JIRA: OVPMS-1768

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Charge and estimate minimum quantities

Good morning Tim. 

How will the system react if a user attempts to delete from the invoice an item that came via a template that has a minimum?

For example, a template that has a surgery pack as minimum of 2. Will an end user just be able to delete it from the invoice and replace it with 1 pack or delete it entirely? 

Thanks, Alan

Re: Charge and estimate minimum quantities

I've updated the project to include requirements to prevent deletion of charge and estimate items with non-zero minimum quantities.

 

Re: Charge and estimate minimum quantities

Thank you Alan for funding this project. Your ongoing support is much apreciated.

Re: Charge and estimate minimum quantities

Ummm, forgive me if I misunderstand the project or how this is going to work.

What happens if someone accidently charges an item with a minimum quantity and then wants to delete that item?

It seems this could be fraught with issues....

Re: Charge and estimate minimum quantities

You are correct. Without support to delete an item, its a little too restrictive. I've removed this restriction.

 

Re: Charge and estimate minimum quantities

Hello Tim.

I know that there has been some offline conversations on this project. Could you please provide an update? As discussed via email, we do not want users to be able to delete services with minimums from estimates/invoices and would prefer to limit products to switching only. 

Thanks, Alan

Re: Charge and estimate minimum quantities

Hello Tim.

Spent some time working in Test to test the system and have a tweak to recommend which I am not sure if it is even feasible. 

At the invoice stage, if you try to reduce the quantity of an item with a minimum below said minimum, you get the expected error message but the value in the field remains the same.  Is it possible for the entry to either revert back to the original quantity or to the minimum quantity? 

Thanks, Alan

Re: Charge and estimate minimum quantities

Possibly, but you wouldn't get any error notification that it had changed. Is that OK?

This could occur when expanding a template where the calculated doses are less than the low quantity.

Re: Charge and estimate minimum quantities

If my choices are between an error message telling you there is an error versus having the system change/correct the quantity automatically without the message, I think the first is a better option. I was trying to save a step but the alert is more important.

Also, not sure if I mentioned it somewhere else. The system will allow for a low quantity to be set that is greater than a high quantity. Trivial in the big picture but would be nice to prevent. 

Alan

Re: Charge and estimate minimum quantities

I've change the estimate item archetype in revision 7152 to add the following to ensure the High Qty >= Low Qty:

       <node name="highQty" path="/details/highQty" type="java.math.BigDecimal" defaultValue="1.0" minCardinality="1">
            <assertion name="nonNegative">
                <errorMessage>Value must be >= 0.0</errorMessage>
            </assertion>
            <assertion name="expression">
                <property name="expression" value="highQty &gt;= lowQty"/>
                <errorMessage>The High Qty must be >= the Low Qty</errorMessage>
            </assertion>
        </node>
Syndicate content