Query regarding non-negative assertions in financial archetypes

Most of the financial archetypes have commented out non-negative assertions sprinkled through

eg.

<node name="unitCost" path="/unitCost"
              type="org.openvpms.component.business.domain.im.datatypes.quantity.Money" minCardinality="1"
              defaultValue="'0.0'" hidden="true">
            <!-- assertion name="nonNegative">
                <errorMessage>Value must be >= 0.0</errorMessage>
            </assertion-->
        </node>

In 1.7 these are not enforced - is the plan to eventually enforce the assertion

In which case should I not bother working around the case of -ve values in unitPrice, qty, fixedPrice and discount fields.

 

Sincerely 

Ben

Comment viewing options

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

Re: Query regarding non-negative assertions in financial ...

Ideally they would be uncommented. They were commented out due to problems encountered migrating legacy data from 3rd party systems.

Re: Query regarding non-negative assertions in financial ...

Tony,  

how much of an issue is this... Can we uncomment the assertion for production servers....and advise implementers they may need to comment them out to do data conversion....

assertions only get checked during data creation or saving. don't they...they don't get checked on viewing old data.

 

ben

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Query regarding non-negative assertions in financial ...

Ben - as a relative recent 'converter from legacy systems' I can attest that I had to handle negative total invoices coming from RxWorks. [These arose from the use of negative prices for a product that was infact a discount - and in some cases the discount exceed the total of the 'real' products.]

I did this in the Kettle code by stripping the negative line items from the invoice and building a separate credit note containing them.

Blocking negative costs causes me no heartache, but blocking a negative price would force the need for another way to implement a discount line item.  I think that there is an existing, but unfunded, project for this.

Regards, Tim G

Re: Query regarding non-negative assertions in financial ...

The reality is that -ve qtys are not supported properly in the current version.  A decision needs to be made one way or the other - to either remove those assertions OR implement them.  

Try using a -ve qty with any item with a fixed price currently.  Even worse try and use a -ve qty with an item that has a discount applied, that has a fixed price included.  

Its a complete disaster.

 

Ben

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Query regarding non-negative assertions in financial ...

Personally I dont understand why profittable business's feel the need to place a discount line item on an invoice at all - I assume they do it this way over adjusting the discount field to emphasize the discount further....they could probably achieve a better result by redesigning the Invoice to show the discount in a clearer fashion.

 

ben

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Query regarding non-negative assertions in financial ...

Ben - I suspect that line items that are discounts are used for two reasons; a) that was how one did it in RxWorks; b) it is simpler and more obvious to the customer to see something at the bottom of the invoice [our product type setup pushes the discounts to the bottom of the invoice] that says "Discount - Valued Client" or "Discount - 4 or more Pets" or "Discount - Large Order".

Note also that the existing discount facility can handle the 'valued client' case, but not the other two.  For the valued client case, although you can tweak the invoice to show the total discount amount in big print, you cannot get the invoice template to work out the reason for the discount.

Regards, Tim G

Re: Query regarding non-negative assertions in financial ...

...I think if you want to be specific about a discount - the simple answer is to make a note in the Invoice note field...make the discount total large and in bold and then the note will tell the client why they are so privileged to receive a discount...

from the sounds of it these discounts are being applied manually, this way you can utilize the existing discount system and then the invoicer can select a reason for the discount...alternative you could take it a step further add a new local lookup to the invoice archetype.  Drop down select and have it appear on the invoice template.  

My overriding point is - this system was never designed to take negatives in an invoice.  We shouldn't be pushing a tweak out in the distribution that is designed for specific problematic cases...If clinics like the one you maintain wish to use a negative then a custom archetype should be rolled out...not the other way around...where anyone wishing to conform to the applications intended design has to roll out a custom archetype.

It applies to a whole heap of specific case's, we should not be coding for a single user case.  If the community as a whole accepts we will use negatives in invoices - that's awesome, we remove the currently commented out assertions and all future and current code is adjusted to work in the case of -ve and +ve values.

 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Query regarding non-negative assertions in financial ...

To add to this:

  • zero quantities are allowed to support billing of fixed fees where no stock is actually supplied. These can have discounts.
  • the Invoice allowances and charges project is designed to allow discount line items. If implemented, this will remove the need for negative quantity kludges to support migration

 

Syndicate content