Bug fixing : irregularities were not saved. Nor were innerloops.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Henri-Damien LAURENT 2007-11-06 14:40:43 -06:00 committed by Joshua Ferraro
parent 06305a58ac
commit 6e6f93c933
3 changed files with 13 additions and 13 deletions

View File

@ -941,19 +941,18 @@ sub GetNextSeq {
$newlastvalue1 = $val->{lastvalue1};
$newlastvalue2 = $val->{lastvalue2};
$newlastvalue3 = $val->{lastvalue3};
$newlastvalue1 = $val->{lastvalue1};
# check if we have to increase the new value.
$newinnerloop1 = $val->{innerloop1}+$val->{add1};
$newinnerloop1=0 if ($newinnerloop1 >= $val->{every1}-$val->{setto1});
$newinnerloop1 = $val->{innerloop1} + 1;
$newinnerloop1=0 if ($newinnerloop1 >= $val->{every1});
$newlastvalue1 += $val->{add1} if ($newinnerloop1<1); # <1 to be true when 0 or empty.
$newlastvalue1=$val->{setto1} if ($newlastvalue1>$val->{whenmorethan1}); # reset counter if needed.
$calculated =~ s/\{X\}/$newlastvalue1/g;
$newlastvalue2 = $val->{lastvalue2};
# check if we have to increase the new value.
$newinnerloop2 = $val->{innerloop2}+$val->{add2};
$newinnerloop2=0 if ($newinnerloop2 >= $val->{every2}-$val->{setto2});
$newinnerloop2 = $val->{innerloop2} + 1;
$newinnerloop2=0 if ($newinnerloop2 >= $val->{every2});
$newlastvalue2 += $val->{add2} if ($newinnerloop2<1); # <1 to be true when 0 or empty.
$newlastvalue2=$val->{setto2} if ($newlastvalue2>$val->{whenmorethan2}); # reset counter if needed.
if ( $pattern == 6 ) {
@ -973,8 +972,8 @@ sub GetNextSeq {
$newlastvalue3 = $val->{lastvalue3};
# check if we have to increase the new value.
$newinnerloop3 = $val->{innerloop3}+$val->{add3};
$newinnerloop3=0 if ($newinnerloop3 >= $val->{every3}-$val->{setto3});
$newinnerloop3 = $val->{innerloop3} + 1;
$newinnerloop3=0 if ($newinnerloop3 >= $val->{every3});
$newlastvalue3 += $val->{add3} if ($newinnerloop3<1); # <1 to be true when 0 or empty.
$newlastvalue3=$val->{setto3} if ($newlastvalue3>$val->{whenmorethan3}); # reset counter if needed.
$calculated =~ s/\{Z\}/$newlastvalue3/g;
@ -1350,7 +1349,7 @@ sub NewSubscription {
$lastvalue3, $innerloop3,
$numberingmethod, "$status",
$notes, $letter,
$firstacquidate, $irregularity,
format_date_in_iso($firstacquidate), $irregularity,
$numberpattern, $callnumber,
$hemisphere, $manualhistory,
$internalnotes

View File

@ -720,7 +720,7 @@ function moreoptionsupdate(fieldnames,rollover){
case "4":
case "5":
case "8":
if (document.f.lastvaluetemp2.value>0){document.f.innerloop1.value = document.f.lastvaluetemp2.value;}
if (document.f.lastvaluetemp2.value>0){document.f.innerloop1.value = document.f.lastvaluetemp2.value - 1;}
break;
}
if(rollover){

View File

@ -172,7 +172,7 @@ if ($op eq 'addsubscription') {
my $firstacquidate = $query->param('firstacquidate');
my $periodicity = $query->param('periodicity');
my $dow = $query->param('dow');
my $irregularity = $query->param('irregularity');
my @irregularity = $query->param('irregular');
my $numberlength = 0;
my $weeklength = 0;
my $monthlength = 0;
@ -186,22 +186,24 @@ if ($op eq 'addsubscription') {
} else {
$numberlength = $sublength;
}
my $add1 = $query->param('add1');
my $every1 = $query->param('every1');
my $whenmorethan1 = $query->param('whenmorethan1');
my $setto1 = $query->param('setto1');
my $lastvalue1 = $query->param('lastvalue1');
my $innerloop1 =$query->param('innerloop1');
my $add2 = $query->param('add2');
my $every2 = $query->param('every2');
my $whenmorethan2 = $query->param('whenmorethan2');
my $setto2 = $query->param('setto2');
my $innerloop2 =$query->param('innerloop2');
my $lastvalue2 = $query->param('lastvalue2');
my $add3 = $query->param('add3');
my $every3 = $query->param('every3');
my $whenmorethan3 = $query->param('whenmorethan3');
my $setto3 = $query->param('setto3');
my $lastvalue3 = $query->param('lastvalue3');
my $innerloop3 =$query->param('innerloop3');
my $numberingmethod = $query->param('numberingmethod');
my $status = 1;
my $biblionumber = $query->param('biblionumber');
@ -212,13 +214,12 @@ if ($op eq 'addsubscription') {
my $letter = $query->param('letter');
### BugFIX : hdl doesnot know what innerloops or letter stand for but it seems necessary. So he adds them.
my $manualhistory = $query->param('manualhist');
my ($innerloop1,$innerloop2,$innerloop3);
my $subscriptionid = NewSubscription($auser,$branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
$numberingmethod, $status, $notes,$letter,$firstacquidate,$irregularity,
$numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity),
$numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes
);