Skip to content

Commit

Permalink
1. Version 2.8.24
Browse files Browse the repository at this point in the history
   2. added reminders; keep track of level
   3. added customernumber variable for generating document control numbers
   4. additional option to calculate check digits according to modulo 10 and 11
	modified:   SL/AA.pm
	modified:   SL/Form.pm
	modified:   SL/IS.pm
	modified:   SL/RC.pm
	modified:   SL/RP.pm
	modified:   VERSION
	modified:   bin/lynx/aa.pl
	modified:   bin/lynx/admin.pl
	modified:   bin/lynx/am.pl
	modified:   bin/lynx/ct.pl
	modified:   bin/lynx/ic.pl
	modified:   bin/lynx/ir.pl
	modified:   bin/lynx/is.pl
	modified:   bin/lynx/rp.pl
	modified:   bin/mozilla/aa.pl
	modified:   bin/mozilla/admin.pl
	modified:   bin/mozilla/am.pl
	modified:   bin/mozilla/ct.pl
	modified:   bin/mozilla/ic.pl
	modified:   bin/mozilla/ir.pl
	modified:   bin/mozilla/is.pl
	modified:   bin/mozilla/rp.pl
	new file:   doc/UPGRADE-2.8.23-2.8.24
	new file:   doc/UPGRADE-2.8.7-2.8.23
	modified:   menu.ini
	modified:   setup.pl
	new file:   templates/Brazilian_Portuguese-reminder1.html
	new file:   templates/Brazilian_Portuguese-reminder1.tex
	new file:   templates/Brazilian_Portuguese-reminder2.html
	new file:   templates/Brazilian_Portuguese-reminder2.tex
	new file:   templates/Brazilian_Portuguese-reminder3.html
	new file:   templates/Brazilian_Portuguese-reminder3.tex
	new file:   templates/Danish-reminder1.html
	new file:   templates/Danish-reminder1.tex
	new file:   templates/Danish-reminder2.html
	new file:   templates/Danish-reminder2.tex
	new file:   templates/Danish-reminder3.html
	new file:   templates/Danish-reminder3.tex
	new file:   templates/Default-reminder1.html
	new file:   templates/Default-reminder1.tex
	new file:   templates/Default-reminder2.html
	new file:   templates/Default-reminder2.tex
	new file:   templates/Default-reminder3.html
	new file:   templates/Default-reminder3.tex
	new file:   templates/Dutch-reminder1.html
	new file:   templates/Dutch-reminder1.tex
	new file:   templates/Dutch-reminder2.html
	new file:   templates/Dutch-reminder2.tex
	new file:   templates/Dutch-reminder3.html
	new file:   templates/Dutch-reminder3.tex
	new file:   templates/Estonian-reminder1.html
	new file:   templates/Estonian-reminder1.tex
	new file:   templates/Estonian-reminder2.html
	new file:   templates/Estonian-reminder2.tex
	new file:   templates/Estonian-reminder3.html
	new file:   templates/Estonian-reminder3.tex
	new file:   templates/Estonian_UTF8-reminder1.html
	new file:   templates/Estonian_UTF8-reminder1.tex
	new file:   templates/Estonian_UTF8-reminder2.html
	new file:   templates/Estonian_UTF8-reminder2.tex
	new file:   templates/Estonian_UTF8-reminder3.html
	new file:   templates/Estonian_UTF8-reminder3.tex
	new file:   templates/French-reminder1.html
	new file:   templates/French-reminder1.tex
	new file:   templates/French-reminder2.html
	new file:   templates/French-reminder2.tex
	new file:   templates/French-reminder3.html
	new file:   templates/French-reminder3.tex
	new file:   templates/German-reminder1.html
	new file:   templates/German-reminder1.tex
	new file:   templates/German-reminder2.html
	new file:   templates/German-reminder2.tex
	new file:   templates/German-reminder3.html
	new file:   templates/German-reminder3.tex
	new file:   templates/Hungarian-reminder1.html
	new file:   templates/Hungarian-reminder1.tex
	new file:   templates/Hungarian-reminder2.html
	new file:   templates/Hungarian-reminder2.tex
	new file:   templates/Hungarian-reminder3.html
	new file:   templates/Hungarian-reminder3.tex
	new file:   templates/Italian-reminder1.html
	new file:   templates/Italian-reminder1.tex
	new file:   templates/Italian-reminder2.html
	new file:   templates/Italian-reminder2.tex
	new file:   templates/Italian-reminder3.html
	new file:   templates/Italian-reminder3.tex
	new file:   templates/Norwegian-reminder1.html
	new file:   templates/Norwegian-reminder1.tex
	new file:   templates/Norwegian-reminder2.html
	new file:   templates/Norwegian-reminder2.tex
	new file:   templates/Norwegian-reminder3.html
	new file:   templates/Norwegian-reminder3.tex
	new file:   templates/Russian-reminder1.html
	new file:   templates/Russian-reminder1.tex
	new file:   templates/Russian-reminder2.html
	new file:   templates/Russian-reminder2.tex
	new file:   templates/Russian-reminder3.html
	new file:   templates/Russian-reminder3.tex
	new file:   templates/Service-reminder1.html
	new file:   templates/Service-reminder1.tex
	new file:   templates/Service-reminder2.html
	new file:   templates/Service-reminder2.tex
	new file:   templates/Service-reminder3.html
	new file:   templates/Service-reminder3.tex
	new file:   templates/Slovak-reminder1.html
	new file:   templates/Slovak-reminder1.tex
	new file:   templates/Slovak-reminder2.html
	new file:   templates/Slovak-reminder2.tex
	new file:   templates/Slovak-reminder3.html
	new file:   templates/Slovak-reminder3.tex
	new file:   templates/Spanish_A4-reminder1.html
	new file:   templates/Spanish_A4-reminder1.tex
	new file:   templates/Spanish_A4-reminder2.html
	new file:   templates/Spanish_A4-reminder2.tex
	new file:   templates/Spanish_A4-reminder3.html
	new file:   templates/Spanish_A4-reminder3.tex
	new file:   templates/Spanish_Letter-reminder1.html
	new file:   templates/Spanish_Letter-reminder1.tex
	new file:   templates/Spanish_Letter-reminder2.html
	new file:   templates/Spanish_Letter-reminder2.tex
	new file:   templates/Spanish_Letter-reminder3.html
	new file:   templates/Spanish_Letter-reminder3.tex
	new file:   templates/Swedish-reminder1.html
	new file:   templates/Swedish-reminder1.tex
	new file:   templates/Swedish-reminder2.html
	new file:   templates/Swedish-reminder2.tex
	new file:   templates/Swedish-reminder3.html
	new file:   templates/Swedish-reminder3.tex
	new file:   templates/Traditional_Chinese_Big5-reminder1.html
	new file:   templates/Traditional_Chinese_Big5-reminder1.tex
	new file:   templates/Traditional_Chinese_Big5-reminder2.html
	new file:   templates/Traditional_Chinese_Big5-reminder2.tex
	new file:   templates/Traditional_Chinese_Big5-reminder3.html
	new file:   templates/Traditional_Chinese_Big5-reminder3.tex
	new file:   templates/Traditional_Chinese_UTF8-reminder1.html
	new file:   templates/Traditional_Chinese_UTF8-reminder1.tex
	new file:   templates/Traditional_Chinese_UTF8-reminder2.html
	new file:   templates/Traditional_Chinese_UTF8-reminder2.tex
	new file:   templates/Traditional_Chinese_UTF8-reminder3.html
	new file:   templates/Traditional_Chinese_UTF8-reminder3.tex
  • Loading branch information
ledger123 committed Apr 17, 2009
1 parent 3d86523 commit baae093
Show file tree
Hide file tree
Showing 140 changed files with 11,121 additions and 156 deletions.
72 changes: 35 additions & 37 deletions SL/AA.pm
Expand Up @@ -21,9 +21,7 @@ sub post_transaction {
my $disconnect = ($dbh) ? 0 : 1;

# connect to database
if (! $dbh) {
$dbh = $form->dbconnect_noauto($myconfig);
}
$dbh = $form->dbconnect_noauto($myconfig) unless $dbh;

my $query;
my $sth;
Expand Down Expand Up @@ -254,6 +252,10 @@ sub post_transaction {


$form->{amount} = $invamount; # need for vr batch

($paymentaccno) = split /--/, $form->{"$form->{ARAP}_paid_$form->{paidaccounts}"};
($null, $paymentmethod_id) = split /--/, $form->{"paymentmethod_$form->{paidaccounts}"};
$paymentmethod_id *= 1;

if ($form->{vc} eq 'customer') {
# dcn
Expand All @@ -269,10 +271,6 @@ sub post_transaction {
for my $dcn (qw(dcn rvc)) { $form->{$dcn} = $form->format_dcn($form->{$dcn}) }
}

($paymentaccno) = split /--/, $form->{"$form->{ARAP}_paid_$form->{paidaccounts}"};
($null, $paymentmethod_id) = split /--/, $form->{"paymentmethod_$form->{paidaccounts}"};
$paymentmethod_id *= 1;


$query = qq|UPDATE $table SET
invnumber = |.$dbh->quote($form->{invnumber}).qq|,
Expand Down Expand Up @@ -1260,7 +1258,7 @@ sub company_details {
my $disconnect = ($dbh) ? 0 : 1;

# connect to database
$dbh = $form->dbconnect($myconfig);
$dbh = $form->dbconnect($myconfig) unless $dbh;

# get rest for the customer/vendor
my $query = qq|SELECT ct.$form->{vc}number, ct.name, ad.address1, ad.address2,
Expand Down Expand Up @@ -1343,35 +1341,35 @@ sub ship_to {
# connect to database
my $dbh = $form->dbconnect($myconfig);

AA->company_details($myconfig, $form, $dbh);

my $table = ($form->{vc} eq 'customer') ? 'ar' : 'ap';

my $query = qq|SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
WHERE trans_id = $form->{"$form->{vc}_id"}
UNION
SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
JOIN oe o ON (o.id = s.trans_id)
WHERE o.$form->{vc}_id = $form->{"$form->{vc}_id"}
UNION
SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
JOIN $table a ON (a.id = s.trans_id)
WHERE a.$form->{vc}_id = $form->{"$form->{vc}_id"}|;
AA->company_details($myconfig, $form, $dbh);

my $table = ($form->{vc} eq 'customer') ? 'ar' : 'ap';

my $query = qq|SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
WHERE trans_id = $form->{"$form->{vc}_id"}
UNION
SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
JOIN oe o ON (o.id = s.trans_id)
WHERE o.$form->{vc}_id = $form->{"$form->{vc}_id"}
UNION
SELECT
s.shiptoname, s.shiptoaddress1, s.shiptoaddress2,
s.shiptocity, s.shiptostate, s.shiptozipcode,
s.shiptocountry, s.shiptocontact, s.shiptophone,
s.shiptofax, s.shiptoemail
FROM shipto s
JOIN $table a ON (a.id = s.trans_id)
WHERE a.$form->{vc}_id = $form->{"$form->{vc}_id"}|;

if ($form->{id}) {
$query .= qq|
Expand Down
65 changes: 54 additions & 11 deletions SL/Form.pm
Expand Up @@ -78,7 +78,7 @@ sub new {

$self->{menubar} = 1 if $self->{path} =~ /lynx/i;

$self->{version} = "2.8.23";
$self->{version} = "2.8.24";
$self->{dbversion} = "2.8.9";

bless $self, $type;
Expand Down Expand Up @@ -1099,11 +1099,11 @@ sub format_line {
@a = reverse @a;
}

$i = $n - 1;
my $j = $n - 1;
$newstr = "";
foreach $str (@a) {
$i++;
if (! ($i % $n)) {
$j++;
if (! ($j % $n)) {
$newstr .= " $str";
} else {
$newstr .= $str;
Expand Down Expand Up @@ -1142,6 +1142,13 @@ sub format_dcn {
my @e;
my $i;

my $d;
my @n;
my $n;
my $w;
my $cd;
my $lr;

for (0 .. $#m) {
@{ $m{$_} } = @m;
$m = shift @m;
Expand All @@ -1155,7 +1162,7 @@ sub format_dcn {
$param = $1;
$str = $param;

($var, $padl) = split / /, $1;
($var, $padl) = split / /, $param;
$padl *= 1;

if ($var eq 'membernumber') {
Expand Down Expand Up @@ -1185,19 +1192,55 @@ sub format_dcn {
while (/\x01(modulo.+?)\x01/) {

$param = $1;


@e = split //, $modulo;

if ($param eq 'modulo10') {
@e = split //, $modulo;
$e = 0;

for (@e) {
$e = $m{$e}[$_];
for $n (@e) {
$e = $m{$e}[$n];
}
$str = substr(10 - $e, -1);
}

/\x01modulo.+?\x01(.+?)\x01modulo.+?\x01/;
$modulo = $1;
if ($param =~ /modulo(1\d+)?_/) {
($n, $w, $lr) = split /_/, $param;
$cd = 0;
$m = $1;

if ($lr eq 'right') {
@e = reverse @e;
}

if ($w eq '12' || $w eq '21') {
@n = split //, $w;

for $i (0 .. $#e) {
$n = $i % 2;
if (($d = $e[$i] * $n[$n]) > 9) {
for $n (split //, $d) {
$cd += $n;
}
} else {
$cd += $d;
}
}
} else {
@n = split //, $w;
for $i (0 .. $#e) {
$n = $i % 2;
$cd += $e[$i] * $n[$n];
}
}

$str = $cd % $m;
if ($m eq '10') {
if ($str > 0) {
$str = $m - $str;
}
}
}

s/\x01$param\x01/$str/;

Expand Down
3 changes: 1 addition & 2 deletions SL/IS.pm
Expand Up @@ -475,13 +475,12 @@ sub invoice_details {
}
}

my ($paymentaccno) = split /--/, $form->{"AR_paid_1"};
my ($paymentaccno) = split /--/, $form->{"AR_paid_$form->{paidaccounts}"};

for $i (1 .. $form->{paidaccounts}) {
if ($form->{"paid_$i"}) {
push(@{ $form->{payment} }, $form->{"paid_$i"});
my ($accno, $description) = split /--/, $form->{"AR_paid_$i"};
$paymentaccno = $accno;
push(@{ $form->{paymentaccount} }, $description);
push(@{ $form->{paymentdate} }, $form->{"datepaid_$i"});
push(@{ $form->{paymentsource} }, $form->{"source_$i"});
Expand Down
4 changes: 2 additions & 2 deletions SL/RC.pm
Expand Up @@ -189,7 +189,7 @@ sub payment_transactions {
$fx_transaction
$transdate
$cleared
UNION
UNION ALL
SELECT ac.transdate, ac.source, ac.fx_transaction,
ac.amount, ac.cleared, a.id, n.name
FROM acc_trans ac
Expand All @@ -201,7 +201,7 @@ sub payment_transactions {
$fx_transaction
$transdate
$cleared
UNION
UNION ALL
SELECT ac.transdate, ac.source, ac.fx_transaction,
ac.amount, ac.cleared, a.id, n.name
FROM acc_trans ac
Expand Down

0 comments on commit baae093

Please sign in to comment.