Change regex to handle currency conversation USD hint.
I found a ticket today with payment-amount set as: "CUR AMOUNT ($OTHER_AMOUNT)" Since the field is free-from I figured I probably need to accept this.
This commit is contained in:
parent
927bb55547
commit
7d24d42788
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ sub FindMostRecentPaymentMethodForTicket ($) {
|
||||||
chomp $curAndAmount; $curAndAmount =~ s/^\s*cf.\{payment-amount\}\s*:\s+(.*)$/$1/i;
|
chomp $curAndAmount; $curAndAmount =~ s/^\s*cf.\{payment-amount\}\s*:\s+(.*)$/$1/i;
|
||||||
$ticketSpec =~ s%^\s*ticket\s*/\s*%%;
|
$ticketSpec =~ s%^\s*ticket\s*/\s*%%;
|
||||||
$curAndAmount = "USD -32767.69" if not defined $curAndAmount;
|
$curAndAmount = "USD -32767.69" if not defined $curAndAmount;
|
||||||
$curAndAmount =~ /^\s*([A-Z]{3,3})\s+([\-\d\,\.]+)\s*$/ or die "Ticket, $ticketSpec, has amount of $curAndAmount";
|
$curAndAmount =~ /^\s*([A-Z]{3,3})\s+([\-\d\,\.]+)(\s+\(\s*\$\s*[\-\d\,\.]+\s*\))?\s*$/
|
||||||
|
or die "Ticket, $ticketSpec, has amount of $curAndAmount";
|
||||||
($AMOUNTS{$ticketSpec}{currency}, $AMOUNTS{$ticketSpec}{amount}) = ($1, $2);
|
($AMOUNTS{$ticketSpec}{currency}, $AMOUNTS{$ticketSpec}{amount}) = ($1, $2);
|
||||||
$AMOUNTS{$ticketSpec}{amount} =~ s/\$//g; $AMOUNTS{$ticketSpec}{amount} =~ s/,//g;
|
$AMOUNTS{$ticketSpec}{amount} =~ s/\$//g; $AMOUNTS{$ticketSpec}{amount} =~ s/,//g;
|
||||||
$AMOUNTS{$ticketSpec}{currency} =~ s/\s//g;
|
$AMOUNTS{$ticketSpec}{currency} =~ s/\s//g;
|
||||||
|
|
Loading…
Reference in a new issue