Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Using Print String to Produce Cheques (Read 2510 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Using Print String to Produce Cheques
Reply #15 - Jan 24th, 2006 at 2:10pm
Print Post Print Post  
Hello Louis,

If vInvDate1 is a date variable that is declared in Sbasic then @IsBlank() will not work on it. @IsBlank is for elements only. Use @IsBlank to check the value of the Date element before assigning that value to a variable.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Using Print String to Produce Cheques
Reply #16 - Jan 24th, 2006 at 2:25pm
Print Post Print Post  
Quote:
Hi Louis...

I recently submitted a concern about this issue. 

So you need to check to see if Date element = 0 vs. Blank.


Hello Bob,

@IsBlank() will work on a date element since it knows the data type of the element it is working on. Which is why you use @IsBlank() rather than <> "".  If a Date element has never been typed in it will appear as blank on the screen and in Sbasic if you write out that value, which is going to format it as a date, you will get 0000/00/00.

When you declare a Date Variable in Sbasic it will have a value of 0000/00/00. There is no such thing as a Null Date. Null is for Strings.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Using Print String to Produce Cheques
Reply #17 - Jan 24th, 2006 at 8:29pm
Print Post Print Post  
Ray:

I got around my date issue by including it as part of another statement that would also result in no invoice date being shown as follows:

     If vInv Amt1 <> "" then
{
PrintString(vInvDate1,100, 175, 0, vFont, vSize, 0)
.............

Therefore, if the Inv AMt above is blank, the date field will not print as there would not likely be an invoice date associated with the transaction..

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Using Print String to Produce Cheques
Reply #18 - Jan 26th, 2006 at 2:24pm
Print Post Print Post  
Ray:

I have just encountered the strangest thing when I printed a cheque.

The invoice amount in the record and cheque total read 54.960.59.

When I print the cheque, both amounts above are off by a penny at 54,960.58.  However, the words on the cheque clearly reflect 59/100.

Have you ever seen this ?

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Using Print String to Produce Cheques
Reply #19 - Jan 26th, 2006 at 2:36pm
Print Post Print Post  
In addition, I just noticed the following:

1. On some cheques, the cents are coming out as .2/100 for 20 cents

2. I have a negative amount in a cheque i.e. credit and it is appearing as -,191.06 when I print the cheque.

Just to let you know, the data I am working with was imported in from a CSV file, if that has anything to do with it.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Using Print String to Produce Cheques
Reply #20 - Jan 26th, 2006 at 2:41pm
Print Post Print Post  
Hello Louis,

Are you using version 1.1.3? There is an error in @Decimals() in 1.1.3 that rounds values rather than truncating them.

If you need this fixed before the release of 1.1.4, send an email to Support@Lantica.com, and I will see if I can get together a HotFix for you.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Using Print String to Produce Cheques
Reply #21 - Jan 26th, 2006 at 3:03pm
Print Post Print Post  
Quote:
In addition, I just noticed the following:

1. On some cheques, the cents are coming out as .2/100 for 20 cents


There are two lines of code in the function MoneyToWords that say
Code
Select All
Cents = @Right(vNet, 2)
Cents = @Right("00" + Cents, 2) 


Change those two lines to
Code
Select All
 Cents = @Right(vNet, @Len(vNet) - @Instr(vNet, "."))
Cents = @Left(Cents + "00", 2)  



Quote:
2. I have a negative amount in a cheque i.e. credit and it is appearing as -,191.06 when I print the cheque.


The FormatMoney() function that I gave you was not built to handle negative numbers as I did not figure checks would be printed with negative numbers. Give the FormatMoney function below a try and let me know if it handles the negative dollar amounts correctly.

Code
Select All
Function FormatMoney(Val as Double) as String
Var vBack as String
Var vWhole as String
Var vFrac as String
Var vDub as Double
Var vNeg as Boolean

vNeg = 0

If Val < 0 Then
{
	vNeg = 1
	Val = @ABS(Val)
}

vWhole = @Str(@Int(Val))
vFrac = @Str(@Frac(Val)) + "00"
While @Len(vWhole) > 3
{
	vBack =  "," + @Right(vWhole, 3) + vBack
	vWhole = @Left(vWhole, @Len(vWhole) - 3)
}
vBack = vWhole + vBack

If @Instr(vFrac, ".") > 0 Then
{
	vDub = @ToNumber(vFrac)
	vFrac = @Str(@Decimals(@Round(vDub, 2), 2))
	vFrac = @Right(vFrac, 2)
}
vBack = "$" + vBack + "." + @Left(vFrac, 2)

If vNeg = 1 Then
{
	vBack = "-" + vBack
}

Return vBack
End Function 



b.t.w. Just out of curiosity, what is the purpose of printing a check with a negative value?

Quote:
Just to let you know, the data I am working with was imported in from a CSV file, if that has anything to do with it.

Thanks,

Louis


You are welcome,
Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Using Print String to Produce Cheques
Reply #22 - Jan 26th, 2006 at 4:01pm
Print Post Print Post  
Hi Ray:

We are using 1.1.3.  If you could get me a fix unless 1.1.4 is coming in the next week.

The negative refers to an invoice amount that is a credit.  The cheque is actually not negative.  I have it set up to enter four different invoices/credits.  In this case the negative reduces the positive invoice amounts.

I will try your code above.

Thanks again,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Using Print String to Produce Cheques
Reply #23 - Jan 26th, 2006 at 4:19pm
Print Post Print Post  
Quote:
We are using 1.1.3.  If you could get me a fix unless 1.1.4 is coming in the next week.


Hello Louis,

You need to send an e-mail to Support@Lantica.com requesting the hotfix, along with a brief description of the problem. Since Hot-Fixes are given out on a case to case basis, Technical Support has to keep track of who gets them, when they were sent, why the HotFix was sent, along with other data.

-Ray

-Edit-
Never mind I just received it. Thank you.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print