[Vtigercrm-developers] Negative values

Musavir Khan musavir at vtiger.com
Thu May 27 05:27:22 PDT 2010


Hi john,

try changing typeofdata to NN~..., from N|I~..

Thanks,
MAK

On Thu, May 27, 2010 at 5:48 PM, John Crisp <john at reetspetit.net> wrote:

> I have been trying to allow negative values for Credit Notes and am well
> & truly stuck and wondered if anyone had any suggestions - see my posts
> http://forums.vtiger.com/viewtopic.php?p=107753
>
> I have managed to allow negative prices in Invoices by amending the
> following :
>
> Inventory.js around Line 334
>
>  From :
> if (!numValidate("listPrice"+i,alert_arr.LIST_PRICE,"any")) return false
>
>
> To :
> if (!numValidate("listPrice"+i,alert_arr.LIST_PRICE,"any","1")) return
> false
>
> But it would be better to allow a negative quantity.
>
> I tried to change the following and add ,"1"
>
>  From :
> if (!numValidate("qty"+i,"Qty","any")) return false
>
> To :
> if (!numValidate("qty"+i,"Qty","any","1")) return false
>
> If I put in a 1 I get 'Qty should be greater than 0' If I put a 0 I get
> 'Invalid Quantity'
>
> I don't understand why it works for one piece of code, but not for the
> other ! Is there something else going on in the numValidate function in
> general.js ?
>
> My guess is that if this cold be solved there is nothing to stop
> creating a Credit Invoice module as it would be pretty well exactly the
> same as an Invoice but with negative numbers, or at least decrementing
> the stock and a minus Total.
>
> Any assistance or thoughts greatly appreciated
> _______________________________________________
> Join vtiger community network at http://forums.vtiger.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20100527/25155c78/attachment-0002.html 


More information about the vtigercrm-developers mailing list