push @a, "employee" if $self->{l_employee};
my $sortorder = join ', ', $form->sort_columns(@a);
$sortorder = $form->{sort} if $form->{sort};
-
+
$query .= "WHERE $where
ORDER by $sortorder";
$form->{amount} = $form->{netamount};
- $form->{tax} = 0;
+ $form->{tax} = 0;
$form->{netamount} = 0;
$form->{total_tax} = 0;
+
# taxincluded doesn't make sense if there is no amount
$form->{taxincluded} = 0 if ($form->{amount} == 0);
$form->{netamount} += $form->{"amount_$i"};
} else {
$form->{"tax_$i"} = $form->{"amount_$i"} * $form->{"taxrate_$i"};
- $form->{"tax_$i"} = $form->round_amount($form->{"tax_$i"} * $form->{exchangerate}, 2);
+ $form->{"tax_$i"} =
+ $form->round_amount($form->{"tax_$i"} * $form->{exchangerate}, 2);
$form->{netamount} += $form->{"amount_$i"};
}
}
$where .= $fromto;
$AR_PAID = "";
$AP_PAID = "";
- $glwhere = ""; # note! gl will be aliased as "a" later...
+ $glwhere = ""; # note! gl will be aliased as "a" later...
}
my $sortorder = join ', ',
$form->sort_columns(qw(transdate reference description));
foreach my $id (@id) {
- # NOTE:
- # Postgres is really picky about the order of implicit CROSS JOINs with ','
- # if you alias the tables and want to use the alias later in another JOIN.
- # the alias you want to use has to be the most recent in the list, otherwise
- # Postgres will overwrite the alias internally and complain.
- # For this reason, in the next 3 SELECTs, the 'a' alias is last in the list.
- # Don't change this, and if you do, substitute the ',' with CROSS JOIN
- # ... that also works.
+ # NOTE:
+ # Postgres is really picky about the order of implicit CROSS JOINs with ','
+ # if you alias the tables and want to use the alias later in another JOIN.
+ # the alias you want to use has to be the most recent in the list, otherwise
+ # Postgres will overwrite the alias internally and complain.
+ # For this reason, in the next 3 SELECTs, the 'a' alias is last in the list.
+ # Don't change this, and if you do, substitute the ',' with CROSS JOIN
+ # ... that also works.
# get all transactions
$query .= qq|$union
$form->{"cp_${_}"} = $form->{"selected_cp_${_}"}
if ($form->{"selected_cp_${_}"});
} qw(title greeting));
-#
+
+ #
# escape '
map { $form->{$_} =~ s/\'/\'\'/g }
qw(customernumber name street zipcode city country homepage contact notes cp_title cp_greeting language pricegroup);
ustid = '$form->{ustid}',
username = '$form->{username}',
salesman_id = '$form->{salesman_id}',
- user_password = | . $dbh->quote($form->{user_password}) .qq|,
+ user_password = | . $dbh->quote($form->{user_password}) . qq|,
c_vendor_id = '$form->{c_vendor_id}',
klass = '$form->{klass}'
WHERE id = $form->{id}|;
my $evfile = "EV01";
my @ed_versionsets;
my $fileno = 0;
-
+
$form->header;
print qq|
<html>
$remaining_bytes -= length($header);
while (scalar(@{ $form->{DATEV} }) > 0) {
- $transaction = shift @{ $form->{DATEV} };
- $trans_lines = scalar(@{$transaction});
+ $transaction = shift @{ $form->{DATEV} };
+ $trans_lines = scalar(@{$transaction});
$counter++;
if (($counter % 500) == 0) {
print("$counter ");
print(EV $ed_versionset[$file]);
}
close(EV);
-print qq|<br>Done. <br></body>
+ print qq|<br>Done. <br></body>
</html>
|;
###
qq|SELECT c.accno, c.description FROM chart c WHERE c.accno >=|
. $dbh->quote($form->{accnofrom}) . qq|
AND c.accno <= |
- . $dbh->quote($form->{accnoto})
- . qq| ORDER BY c.accno|;
+ . $dbh->quote($form->{accnoto}) . qq| ORDER BY c.accno|;
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
sub quote {
my ($self, $str) = @_;
- if ($str && ! ref($str)) {
+ if ($str && !ref($str)) {
$str =~ s/"/"/g;
}
}
-
sub unquote {
my ($self, $str) = @_;
- if ($str && ! ref($str)) {
+ if ($str && !ref($str)) {
$str =~ s/"/"/g;
}
}
-
sub hide_form {
my $self = shift;
if (@_) {
- for (@_) { print qq|<input type=hidden name="$_" value="|.$self->quote($self->{$_}).qq|">\n| }
+ for (@_) {
+ print qq|<input type=hidden name="$_" value="|
+ . $self->quote($self->{$_})
+ . qq|">\n|;
+ }
} else {
delete $self->{header};
- for (sort keys %$self) { print qq|<input type=hidden name="$_" value="|.$self->quote($self->{$_}).qq|">\n| }
+ for (sort keys %$self) {
+ print qq|<input type=hidden name="$_" value="|
+ . $self->quote($self->{$_})
+ . qq|">\n|;
+ }
}
-
+
}
sub error {
push @triggers, qq|
Calendar.setup(
{
- inputField : "|.(shift).qq|",
+ inputField : "| . (shift) . qq|",
ifFormat :"$ifFormat",
- align : "|.(shift).qq|",
- button : "|.(shift).qq|"
+ align : "| . (shift) . qq|",
+ button : "| . (shift) . qq|"
}
);
|;
}
$jsscript = qq|
<script type="text/javascript">
- <!--|.join("", @triggers).qq|//-->
+ <!--| . join("", @triggers) . qq|//-->
</script>
|;
$main::lxdebug->enter_sub();
my ($self, $myconfig, $amount, $places, $dash) = @_;
-
+
#Workaround for $format_amount calls without $places
- if (!defined $places){
- (my $dec) = ($amount =~ /\.(\d+)/);
- $places = length $dec;
- }
+ if (!defined $places) {
+ (my $dec) = ($amount =~ /\.(\d+)/);
+ $places = length $dec;
+ }
if ($places =~ /\d/) {
$amount = $self->round_amount($amount, $places);
# is the amount negative
my $negative = ($amount < 0);
- my $fillup = "";
+ my $fillup = "";
if ($amount != 0) {
if ($myconfig->{numberformat} && ($myconfig->{numberformat} ne '1000.00'))
$amount =~ s/\d{3,}?/$&,/g;
$amount =~ s/,$//;
$amount = join '', reverse split //, $amount;
- $amount .= "\.$dec".$fillup if ($places ne '' && $places*1 != 0);
+ $amount .= "\.$dec" . $fillup if ($places ne '' && $places * 1 != 0);
}
if ($myconfig->{numberformat} eq '1.000,00') {
$amount =~ s/\d{3,}?/$&./g;
$amount =~ s/\.$//;
$amount = join '', reverse split //, $amount;
- $amount .= ",$dec".$fillup if ($places ne '' && $places*1 != 0);
+ $amount .= ",$dec" . $fillup if ($places ne '' && $places * 1 != 0);
}
if ($myconfig->{numberformat} eq '1000,00') {
$amount = "$whole";
- $amount .= ",$dec" .$fillup if ($places ne '' && $places*1 != 0);
+ $amount .= ",$dec" . $fillup if ($places ne '' && $places * 1 != 0);
}
if ($dash =~ /-/) {
$main::lxdebug->enter_sub();
my ($self, $myconfig, $amount) = @_;
- $main::lxdebug->message(LXDebug::DEBUG2, "Start amount: $amount");
-
- if ($myconfig->{in_numberformat} == 1){
+ $main::lxdebug->message(LXDebug::DEBUG2, "Start amount: $amount");
+
+ if ($myconfig->{in_numberformat} == 1) {
+
# Extra input number format 1000.00 or 1000,00
- $main::lxdebug->message(LXDebug::DEBUG2, "in_numberformat: " . $main::locale->text('1000,00 or 1000.00'));
+ $main::lxdebug->message(LXDebug::DEBUG2,
+ "in_numberformat: " . $main::locale->text('1000,00 or 1000.00'));
$amount =~ s/,/\./g;
+
#$main::lxdebug->message(LXDebug::DEBUG2, "1.Parsed Number: $amount") if ($amount);
$amount = scalar reverse $amount;
+
#$main::lxdebug->message(LXDebug::DEBUG2, "2.Parsed Number: $amount") if ($amount);
$amount =~ s/\./DOT/;
+
#$main::lxdebug->message(LXDebug::DEBUG2, "3.Parsed Number: $amount") if ($amount);
$amount =~ s/\.//g;
+
#$main::lxdebug->message(LXDebug::DEBUG2, "4.Parsed Number: $amount") if ($amount);
$amount =~ s/DOT/\./;
+
#$main::lxdebug->message(LXDebug::DEBUG2, "5.Parsed Number:" . $amount) if ($amount);
- $amount = scalar reverse $amount ;
- $main::lxdebug->message(LXDebug::DEBUG2, "Parsed amount:" . $amount . "\n");
+ $amount = scalar reverse $amount;
+ $main::lxdebug->message(LXDebug::DEBUG2,
+ "Parsed amount:" . $amount . "\n");
return ($amount * 1);
}
- $main::lxdebug->message(LXDebug::DEBUG2, "in_numberformat: " . $main::locale->text('equal Outputformat'));
- $main::lxdebug->message(LXDebug::DEBUG2, " = numberformat: $myconfig->{numberformat}");
+ $main::lxdebug->message(LXDebug::DEBUG2,
+ "in_numberformat: " . $main::locale->text('equal Outputformat'));
+ $main::lxdebug->message(LXDebug::DEBUG2,
+ " = numberformat: $myconfig->{numberformat}");
if ( ($myconfig->{numberformat} eq '1.000,00')
|| ($myconfig->{numberformat} eq '1000,00')) {
$amount =~ s/\.//g;
}
if ($myconfig->{numberformat} eq "1'000.00") {
- $amount =~ s/'//g;
+ $amount =~ s/'//g;
}
$amount =~ s/,//g;
-
- $main::lxdebug->message(LXDebug::DEBUG2, "Parsed amount:" . $amount. "\n") if ($amount);
+
+ $main::lxdebug->message(LXDebug::DEBUG2, "Parsed amount:" . $amount . "\n")
+ if ($amount);
$main::lxdebug->leave_sub();
-
+
return ($amount * 1);
}
# Rounding like "Kaufmannsrunden"
# Descr. http://de.wikipedia.org/wiki/Rundung
- # Inspired by
+ # Inspired by
# http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q4.13.html
# Solves Bug: 189
# Udo Spallek
- $amount = $amount * (10 ** ($places));
- $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places));
+ $amount = $amount * (10**($places));
+ $round_amount = int($amount + .5 * ($amount <=> 0)) / (10**($places));
$main::lxdebug->leave_sub();
return $round_amount;
-
-}
-
+}
sub parse_template {
$main::lxdebug->enter_sub();
}
# Yes we need a manual page break -- or the user has forced one
- if ((($current_line + $lines) > $lpp) ||
- ($self->{"_forced_pagebreaks"} && grep(/^${current_row}$/, @{$self->{"_forced_pagebreaks"}}))) {
+ if (
+ (($current_line + $lines) > $lpp)
+ || ($self->{"_forced_pagebreaks"}
+ && grep(/^${current_row}$/, @{ $self->{"_forced_pagebreaks"} }))
+ ) {
my $pb = $pagebreak;
# replace the special variables <%sumcarriedforward%>
my %unique_fields;
%unique_fields = map({ $_ => 1 } @fields);
- @fields = keys(%unique_fields);
+ @fields = keys(%unique_fields);
foreach my $field (@fields) {
next unless ($self->{$field} =~ /\<pagebreak\>/);
$main::lxdebug->enter_sub();
my ($self, $dbh, $curr, $transdate, $fld) = @_;
-
+
unless ($transdate) {
$main::lxdebug->leave_sub();
return "";
my ($self, $dbh, $id) = @_;
##LINET
my $shipto;
- foreach
- my $item (qw(name department_1 department_2 street zipcode city country contact phone fax email)) {
+ foreach my $item (
+ qw(name department_1 department_2 street zipcode city country contact phone fax email)
+ ) {
if ($self->{"shipto$item"}) {
$shipto = 1 if ($self->{$item} ne $self->{"shipto$item"});
}
}
if ($shipto) {
- my $query = qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2, shiptostreet,
+ my $query =
+ qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2, shiptostreet,
shiptozipcode, shiptocity, shiptocountry, shiptocontact,
shiptophone, shiptofax, shiptoemail) VALUES ($id,
'$self->{shiptoname}', '$self->{shiptodepartment_1}', '$self->{shiptodepartment_2}', '$self->{shiptostreet}',
my %xkeyref = ();
# now get the account numbers
- $query =
- qq|SELECT c.accno, c.description, c.link, c.taxkey_id
+ $query = qq|SELECT c.accno, c.description, c.link, c.taxkey_id
FROM chart c
WHERE c.link LIKE '%$module%'
ORDER BY c.accno|;
$self->{exchangerate} =
$self->get_exchangerate($dbh, $self->{currency}, $self->{transdate},
$fld);
- my $index=0;
+ my $index = 0;
# store amounts in {acc_trans}{$key} for multiple accounts
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
$ref->{exchangerate} =
$self->get_exchangerate($dbh, $self->{currency}, $ref->{transdate},
$fld);
- if ( !($xkeyref{ $ref->{accno} } =~ /tax/)) {
+ if (!($xkeyref{ $ref->{accno} } =~ /tax/)) {
$index++;
}
$ref->{index} = $index;
$main::lxdebug->leave_sub();
}
-
sub get_pricegroup {
$main::lxdebug->enter_sub();
$main::lxdebug->leave_sub();
}
-
sub audittrail {
my ($self, $dbh, $myconfig, $audittrail) = @_;
-
-# table, $reference, $formname, $action, $id, $transdate) = @_;
+
+ # table, $reference, $formname, $action, $id, $transdate) = @_;
my $query;
my $rv;
my $disconnect;
- if (! $dbh) {
- $dbh = $self->dbconnect($myconfig);
+ if (!$dbh) {
+ $dbh = $self->dbconnect($myconfig);
$disconnect = 1;
}
-
+
# if we have an id add audittrail, otherwise get a new timestamp
-
+
if ($audittrail->{id}) {
-
+
$query = qq|SELECT audittrail FROM defaults|;
-
+
if ($dbh->selectrow_array($query)) {
my ($null, $employee_id) = $self->get_employee($dbh);
if ($self->{audittrail} && !$myconfig) {
- chop $self->{audittrail};
-
- my @a = split /\|/, $self->{audittrail};
- my %newtrail = ();
- my $key;
- my $i;
- my @flds = qw(tablename reference formname action transdate);
-
- # put into hash and remove dups
- while (@a) {
- $key = "$a[2]$a[3]";
- $i = 0;
- $newtrail{$key} = { map { $_ => $a[$i++] } @flds };
- splice @a, 0, 5;
- }
-
- $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
+ chop $self->{audittrail};
+
+ my @a = split /\|/, $self->{audittrail};
+ my %newtrail = ();
+ my $key;
+ my $i;
+ my @flds = qw(tablename reference formname action transdate);
+
+ # put into hash and remove dups
+ while (@a) {
+ $key = "$a[2]$a[3]";
+ $i = 0;
+ $newtrail{$key} = { map { $_ => $a[$i++] } @flds };
+ splice @a, 0, 5;
+ }
+
+ $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
formname, action, employee_id, transdate)
VALUES ($audittrail->{id}, ?, ?,
?, ?, $employee_id, ?)|;
- my $sth = $dbh->prepare($query) || $self->dberror($query);
-
- foreach $key (sort { $newtrail{$a}{transdate} cmp $newtrail{$b}{transdate} } keys %newtrail) {
- $i = 1;
- for (@flds) { $sth->bind_param($i++, $newtrail{$key}{$_}) }
-
- $sth->execute || $self->dberror;
- $sth->finish;
- }
+ my $sth = $dbh->prepare($query) || $self->dberror($query);
+
+ foreach $key (
+ sort {
+ $newtrail{$a}{transdate} cmp $newtrail{$b}{transdate}
+ } keys %newtrail
+ ) {
+ $i = 1;
+ for (@flds) { $sth->bind_param($i++, $newtrail{$key}{$_}) }
+
+ $sth->execute || $self->dberror;
+ $sth->finish;
+ }
}
-
if ($audittrail->{transdate}) {
- $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
+ $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
formname, action, employee_id, transdate) VALUES (
$audittrail->{id}, '$audittrail->{tablename}', |
- .$dbh->quote($audittrail->{reference}).qq|,
+ . $dbh->quote($audittrail->{reference}) . qq|,
'$audittrail->{formname}', '$audittrail->{action}',
$employee_id, '$audittrail->{transdate}')|;
} else {
- $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
+ $query = qq|INSERT INTO audittrail (trans_id, tablename, reference,
formname, action, employee_id) VALUES ($audittrail->{id},
'$audittrail->{tablename}', |
- .$dbh->quote($audittrail->{reference}).qq|,
+ . $dbh->quote($audittrail->{reference}) . qq|,
'$audittrail->{formname}', '$audittrail->{action}',
$employee_id)|;
}
$dbh->do($query);
}
} else {
-
+
$query = qq|SELECT current_timestamp FROM defaults|;
my ($timestamp) = $dbh->selectrow_array($query);
- $rv = "$audittrail->{tablename}|$audittrail->{reference}|$audittrail->{formname}|$audittrail->{action}|$timestamp|";
+ $rv =
+ "$audittrail->{tablename}|$audittrail->{reference}|$audittrail->{formname}|$audittrail->{action}|$timestamp|";
}
$dbh->disconnect if $disconnect;
-
+
$rv;
-
+
}
package Locale;
$apwhere .= " AND c.gifi_accno = '$form->{gifi_accno}'";
}
if ($form->{category} ne 'X') {
- $glwhere .= " AND gl.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
- $arwhere .= " AND ar.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
- $apwhere .= " AND ap.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
+ $glwhere .=
+ " AND gl.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
+ $arwhere .=
+ " AND ar.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
+ $apwhere .=
+ " AND ap.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))";
}
if ($form->{accno}) {
my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE: q|'0'|;
- my $sortorder = join ', ', $form->sort_columns(qw(transdate reference source description accno));
- my %ordinal = ( transdate => 6,
- reference => 4,
- source => 7,
- description => 5 );
- map { $sortorder =~ s/$_/$ordinal{$_}/ } keys %ordinal;
-
- if ($form->{sort}) {
- $sortorder = $form->{sort} . ",";
- } else {
- $sortorder = "";
- }
-
+ my $sortorder = join ', ',
+ $form->sort_columns(qw(transdate reference source description accno));
+ my %ordinal = (transdate => 6,
+ reference => 4,
+ source => 7,
+ description => 5);
+ map { $sortorder =~ s/$_/$ordinal{$_}/ } keys %ordinal;
+
+ if ($form->{sort}) {
+ $sortorder = $form->{sort} . ",";
+ } else {
+ $sortorder = "";
+ }
+
my $query =
qq|SELECT g.id, 'gl' AS type, $false AS invoice, g.reference, ac.taxkey, t.taxkey AS sorttax,
g.description, ac.transdate, ac.source, ac.trans_id,
ORDER BY $sortorder transdate, trans_id, taxkey DESC, sorttax DESC,oid|;
my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- my $trans_id = "";
+ my $trans_id = "";
my $trans_id2 = "";
while (my $ref0 = $sth->fetchrow_hashref(NAME_lc)) {
$trans_id = $ref0->{id};
push @{ $form->{GL} }, $ref;
$balance = 0;
}
- $ref = $ref0;
+ $ref = $ref0;
$trans_id2 = $ref->{id};
-
+
# gl
if ($ref->{type} eq "gl") {
$ref->{module} = "gl";
}
+
# ap
if ($ref->{type} eq "ap") {
if ($ref->{invoice}) {
$ref->{module} = "ap";
}
}
-
+
# ar
if ($ref->{type} eq "ar") {
if ($ref->{invoice}) {
}
}
} else {
- $ref2 = $ref0;
+ $ref2 = $ref0;
$trans_id2 = $ref2->{id};
-# if ($form->{accno} eq ''){ # flo & udo: if general report,
- # then check balance
-# while (abs($balance) >= 0.015) {
-# my $ref2 = $sth->fetchrow_hashref(NAME_lc)
-# || $form->error("Unbalanced ledger!");
-#
- $balance =
- (int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000;
- if ($ref2->{amount} < 0) {
- if ($ref2->{chart_id} > 0) {
- if ($ref->{debit_tax_accno}{$i} ne "") {
- $i++;
- }
- $ref->{debit_tax}{$i} = $ref2->{amount} * -1;
- $ref->{debit_tax_accno}{$i} = $ref2->{accno};
- } else {
- if ($ref->{debit_accno}{$k} ne "") {
- $k++;
- }
- $ref->{debit}{$k} = $ref2->{amount} * -1;
- $ref->{debit_accno}{$k} = $ref2->{accno};
- $ref->{debit_taxkey}{$k} = $ref2->{taxkey};
- }
- } else {
- if ($ref2->{chart_id} > 0) {
- if ($ref->{credit_tax_accno}{$j} ne "") {
- $j++;
- }
- $ref->{credit_tax}{$j} = $ref2->{amount};
- $ref->{credit_tax_accno}{$j} = $ref2->{accno};
- } else {
- if ($ref->{credit_accno}{$l} ne "") {
- $l++;
- }
- $ref->{credit}{$l} = $ref2->{amount};
- $ref->{credit_accno}{$l} = $ref2->{accno};
- $ref->{credit_taxkey}{$l} = $ref2->{taxkey};
- }
+
+ # if ($form->{accno} eq ''){ # flo & udo: if general report,
+ # then check balance
+ # while (abs($balance) >= 0.015) {
+ # my $ref2 = $sth->fetchrow_hashref(NAME_lc)
+ # || $form->error("Unbalanced ledger!");
+ #
+ $balance =
+ (int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000;
+ if ($ref2->{amount} < 0) {
+ if ($ref2->{chart_id} > 0) {
+ if ($ref->{debit_tax_accno}{$i} ne "") {
+ $i++;
}
-# }
-# } else {
-# # if account-report, then calculate the Balance?!
-# # ToDo: Calculate the Balance
-# 1;
-# }
+ $ref->{debit_tax}{$i} = $ref2->{amount} * -1;
+ $ref->{debit_tax_accno}{$i} = $ref2->{accno};
+ } else {
+ if ($ref->{debit_accno}{$k} ne "") {
+ $k++;
+ }
+ $ref->{debit}{$k} = $ref2->{amount} * -1;
+ $ref->{debit_accno}{$k} = $ref2->{accno};
+ $ref->{debit_taxkey}{$k} = $ref2->{taxkey};
+ }
+ } else {
+ if ($ref2->{chart_id} > 0) {
+ if ($ref->{credit_tax_accno}{$j} ne "") {
+ $j++;
+ }
+ $ref->{credit_tax}{$j} = $ref2->{amount};
+ $ref->{credit_tax_accno}{$j} = $ref2->{accno};
+ } else {
+ if ($ref->{credit_accno}{$l} ne "") {
+ $l++;
+ }
+ $ref->{credit}{$l} = $ref2->{amount};
+ $ref->{credit_accno}{$l} = $ref2->{accno};
+ $ref->{credit_taxkey}{$l} = $ref2->{taxkey};
+ }
+ }
+
+ # }
+ # } else {
+ # # if account-report, then calculate the Balance?!
+ # # ToDo: Calculate the Balance
+ # 1;
+ # }
}
-
}
push @{ $form->{GL} }, $ref;
package IC;
use Data::Dumper;
+
sub get_part {
$main::lxdebug->enter_sub();
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form) = @_;
- my $dbh = $form->dbconnect($myconfig);
- my $i = 1;
+ my $dbh = $form->dbconnect($myconfig);
+ my $i = 1;
my @pricegroups_not_used = ();
# get pricegroups
$main::lxdebug->leave_sub();
}
-
sub save {
$main::lxdebug->enter_sub();
# insert price records only if different to sellprice
for my $i (1 .. $form->{price_rows}) {
if ($form->{"price_$i"} eq "0") {
- $form->{"price_$i"} = $form->{sellprice};
+ $form->{"price_$i"} = $form->{sellprice};
}
- if (( $form->{"price_$i"}
- || $form->{"klass_$i"}
- || $form->{"pricegroup_id_$i"}) and $form->{"price_$i"} != $form->{sellprice}) {
+ if (
+ ( $form->{"price_$i"}
+ || $form->{"klass_$i"}
+ || $form->{"pricegroup_id_$i"})
+ and $form->{"price_$i"} != $form->{sellprice}
+ ) {
$klass = $form->parse_amount($myconfig, $form->{"klass_$i"});
$price = $form->parse_amount($myconfig, $form->{"price_$i"});
$pricegroup_id =
$ordwhere .= " AND lower(oi.description) LIKE '$var'";
}
- $flds = qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
+ $flds =
+ qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
}
if ($form->{onorder}) {
- $flds = qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
+ $flds =
+ qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty * -1 AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
$quowhere .= " AND lower(oi.description) LIKE '$var'";
}
- $flds = qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
+ $flds =
+ qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
}
if ($form->{rfq}) {
- $flds = qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
+ $flds =
+ qq|p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty * -1 AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
push(@{ $form->{description} }, qq|$form->{"description_$i"}|);
push(@{ $form->{qty} },
$form->format_amount($myconfig, $form->{"qty_$i"}));
- push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|);
+ push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|);
push(@{ $form->{deliverydate_oe} }, qq|$form->{"deliverydate_$i"}|);
- push(@{ $form->{sellprice} }, $form->{"sellprice_$i"});
+ push(@{ $form->{sellprice} }, $form->{"sellprice_$i"});
push(@{ $form->{ordnumber_oe} }, qq|$form->{"ordnumber_$i"}|);
push(@{ $form->{transdate_oe} }, qq|$form->{"transdate_$i"}|);
$dec = length $dec;
my $decimalplaces = ($dec > 2) ? $dec : 2;
- my $i_discount = $form->round_amount($sellprice *
- $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces);
+ my $i_discount =
+ $form->round_amount(
+ $sellprice * $form->parse_amount($myconfig,
+ $form->{"discount_$i"}) / 100,
+ $decimalplaces);
- my $discount = $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces);
+ my $discount =
+ $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces);
# keep a netprice as well, (sellprice - discount)
$form->{"netprice_$i"} = $sellprice - $i_discount;
: " ";
$linetotal = ($linetotal != 0) ? $linetotal : " ";
- push(@{ $form->{discount} }, $discount);
+ push(@{ $form->{discount} }, $discount);
push(@{ $form->{p_discount} }, $form->{"discount_$i"});
$form->{total} += $linetotal;
# set values which could be empty to 0
$form->{terms} *= 1;
$form->{taxincluded} *= 1;
- my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL";
- my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL";
- my $deliverydate = ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL";
+ my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL";
+ my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL";
+ my $deliverydate =
+ ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL";
# fill in subject if there is none
$form->{subject} = qq|$form->{label} $form->{invnumber}|
package LXDebug;
-use constant NONE => 0;
-use constant INFO => 1;
+use constant NONE => 0;
+use constant INFO => 1;
use constant DEBUG1 => 2;
use constant DEBUG2 => 3;
for my $i (1 .. $form->{rowcount}) {
map {
- $form->{"${_}_$i"} = $form->parse_amount($myconfig, $form->{"${_}_$i"})
+ $form->{"${_}_$i"} =
+ $form->parse_amount($myconfig, $form->{"${_}_$i"})
} qw(qty ship);
if ($form->{"qty_$i"}) {
return $rc;
}
-# this function closes multiple orders given in $form->{ordnumber_#}.
+# this function closes multiple orders given in $form->{ordnumber_#}.
# use this for multiple orders that don't have to be saved back
# single orders should use OE::save instead.
sub close_orders {
$main::lxdebug->enter_sub();
- my ($self, $myconfig ,$form) = @_;
+ my ($self, $myconfig, $form) = @_;
for my $i (1 .. $form->{rowcount}) {
map {
- $form->{"${_}_$i"} = $form->parse_amount($myconfig, $form->{"${_}_$i"})
+ $form->{"${_}_$i"} =
+ $form->parse_amount($myconfig, $form->{"${_}_$i"})
} qw(qty ship);
if ($delete_oe_id) {
$form->{"orderitems_id_$i"} = "";
$form->parse_amount($myconfig, $form->{"sellprice_$i"});
}
}
+
# get ids from $form
- map { push @ids, $form->{"ordnumber_$_"} if $form->{"ordnumber_$_"} } (1 .. $form->{rowcount});
-
+ map { push @ids, $form->{"ordnumber_$_"} if $form->{"ordnumber_$_"} }
+ (1 .. $form->{rowcount});
+
my $dbh = $form->dbconnect($myconfig);
$query = qq|UPDATE oe SET
closed = TRUE
- WHERE ordnumber IN (|.join(', ', map{ $dbh->quote($_) }@ids).qq|)|;
+ WHERE ordnumber IN (|
+ . join(', ', map { $dbh->quote($_) } @ids) . qq|)|;
$dbh->do($query) || $form->dberror($query);
$dbh->disconnect;
my $query, @ids;
# translate the ids (given by id_# and trans_id_#) into one array of ids, so we can join them later
- map { push @ids, $form->{"trans_id_$_"} if ($form->{"id_$_"} and $form->{"trans_id_$_"}) } (1 .. $form->{"rowcount"});
+ map {
+ push @ids, $form->{"trans_id_$_"}
+ if ($form->{"id_$_"} and $form->{"trans_id_$_"})
+ } (1 .. $form->{"rowcount"});
- # if called in multi id mode, and still only got one id, switch back to single id
+ # if called in multi id mode, and still only got one id, switch back to single id
if ($form->{"rowcount"} and $#ids == 0) {
$form->{"id"} = $ids[0];
undef @ids;
($form->{currency}) = split /:/, $form->{currencies};
- # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure
+ # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure
# we come from invoices, feel free.
- $form->{reqdate} = $form->{deliverydate} if ($form->{deliverydate} and $form->{callback} =~ /action=ar_transactions/);
+ $form->{reqdate} = $form->{deliverydate}
+ if ( $form->{deliverydate}
+ and $form->{callback} =~ /action=ar_transactions/);
if ($form->{id} or @ids) {
# retrieve order for single id
# NOTE: this query is intended to fetch all information only ONCE.
- # so if any of these infos is important (or even different) for any item,
+ # so if any of these infos is important (or even different) for any item,
# it will be killed out and then has to be fetched from the item scope query further down
$query = qq|SELECT o.cp_id, o.ordnumber, o.transdate, o.reqdate,
o.taxincluded, o.shippingpoint, o.shipvia, o.notes, o.intnotes,
JOIN $form->{vc} cv ON (o.$form->{vc}_id = cv.id)
LEFT JOIN employee e ON (o.employee_id = e.id)
LEFT JOIN department d ON (o.department_id = d.id)
- |. ($form->{id}
- ? qq|WHERE o.id = $form->{id}|
- : qq|WHERE o.id IN (|.join(', ', @ids).qq|)|
- );
+ |
+ . ($form->{id}
+ ? qq|WHERE o.id = $form->{id}|
+ : qq|WHERE o.id IN (| . join(', ', @ids) . qq|)|);
-#$main::lxdebug->message(0, $query);
+ #$main::lxdebug->message(0, $query);
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
}
# if not given, fill transdate with current_date
- $form->{transdate} = $form->current_date($myconfig) unless $form->{transdate};
+ $form->{transdate} = $form->current_date($myconfig)
+ unless $form->{transdate};
$sth->finish;
- # shipto and pinted/mailed/queued status makes only sense for single id retrieve
+ # shipto and pinted/mailed/queued status makes only sense for single id retrieve
if (!@ids) {
$query = qq|SELECT s.* FROM shipto s
WHERE s.trans_id = $form->{id}|;
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
$form->{printed} .= "$ref->{formname} " if $ref->{printed};
$form->{emailed} .= "$ref->{formname} " if $ref->{emailed};
- $form->{queued} .= "$ref->{formname} $ref->{spoolfile} " if $ref->{spoolfile};
+ $form->{queued} .= "$ref->{formname} $ref->{spoolfile} "
+ if $ref->{spoolfile};
}
$sth->finish;
map { $form->{$_} =~ s/ +$//g } qw(printed emailed queued);
- } # if !@ids
+ } # if !@ids
my %oid = ('Pg' => 'oid',
'Oracle' => 'rowid');
LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
LEFT JOIN project pr ON (o.project_id = pr.id)
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
- |. ($form->{id}
- ? qq|WHERE o.trans_id = $form->{id}|
- : qq|WHERE o.trans_id IN (|.join(", ", @ids).qq|)|
- ).qq|
+ |
+ . ($form->{id}
+ ? qq|WHERE o.trans_id = $form->{id}|
+ : qq|WHERE o.trans_id IN (| . join(", ", @ids) . qq|)|)
+ . qq|
ORDER BY o.$oid{$myconfig->{dbdriver}}|;
-
+
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
-
+
# in collective order, copy global ordnumber, transdate, cusordnumber into item scope
- # unless already present there
+ # unless already present there
# remove _oe entries afterwards
map { $ref->{$_} = $ref->{"${_}_oe"} if ($ref->{$_} eq '') }
- qw|ordnumber transdate cusordnumber| if (@ids);
- map{ delete $ref->{$_} }
- qw|ordnumber_oe transdate_oe cusordnumber_oe|;
+ qw|ordnumber transdate cusordnumber|
+ if (@ids);
+ map { delete $ref->{$_} } qw|ordnumber_oe transdate_oe cusordnumber_oe|;
#set expense_accno=inventory_accno if they are different => bilanz
$vendor_accno =
$dec = length $dec;
my $decimalplaces = ($dec > 2) ? $dec : 2;
- my $i_discount = $form->round_amount($sellprice *
- $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces);
+ my $i_discount =
+ $form->round_amount(
+ $sellprice * $form->parse_amount($myconfig,
+ $form->{"discount_$i"}) / 100,
+ $decimalplaces);
- my $discount = $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces);
+ my $discount =
+ $form->round_amount($form->{"qty_$i"} * $i_discount, $decimalplaces);
# keep a netprice as well, (sellprice - discount)
#$form->{"netprice_$i"} = $sellprice - $discount;
: " ";
$linetotal = ($linetotal != 0) ? $linetotal : " ";
- push(@{ $form->{discount} }, $discount);
+ push(@{ $form->{discount} }, $discount);
push(@{ $form->{p_discount} }, $form->{"discount_$i"});
$form->{ordtotal} += $linetotal;
}
}
- $tax_rate = $taxrate*100;
+ $tax_rate = $taxrate * 100;
push(@{ $form->{tax_rate} }, qq|$tax_rate|);
if ($form->{"assembly_$i"}) {
package RP;
-
sub balance_sheet {
$main::lxdebug->enter_sub();
my @accno;
my $accno;
my $ref;
+
#print $query;
my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
my $sortorder = join ', ',
$form->sort_columns(qw(name invnumber ordnumber transdate source));
- $sortorder = $form->{sort} if $form->{sort};
-
+ $sortorder = $form->{sort} if $form->{sort};
+
# cycle through each id
foreach my $accno (split(/ /, $form->{paymentaccounts})) {
$form->{ "$key" . "gesamtleistung" } = 0;
$form->{ "$key" . "gesamtkosten" } = 0;
-
foreach $category (@categories) {
if (defined($form->{$category}{$key})) {
$form->{"$key$category"} =
$form->format_amount($myconfig,
$form->round_amount($form->{$category}{$key}, 2
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@gesamtleistung) {
$form->{ "$key" . "ergebnisvorsteuern" } =
$form->{ "$key" . "betriebsergebnis" } -
$form->{ "$key" . "neutraleraufwand" } +
- $form->{ "$key" . "neutralertrag" };
+ $form->{ "$key" . "neutralertrag" };
$form->{ "$key" . "ergebnis" } =
$form->{ "$key" . "ergebnisvorsteuern" } + $form->{35}{$key};
$form->{ "$key" . "gesamtleistung" } * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@ergebnisse) {
$form->{ "$key" . "gesamtleistung" } * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
$form->{ "$key" . "gesamtkosten" } * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@ergebnisse) {
$form->{ "$key" . "gesamtkosten" } * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
if (defined($form->{$category}{$key})) {
$form->{ "$key" . "pk" . "$category" } =
$form->format_amount(
- $myconfig,
- $form->round_amount(
- ($form->{$category}{$key} / $form->{10}{$key} * 100),
- $form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ $myconfig,
+ $form->round_amount(
+ ($form->{$category}{$key} / $form->{10}{$key} * 100),
+ $form->{decimalplaces}
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@ergebnisse) {
$form->{10}{$key} * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
if (defined($form->{$category}{$key})) {
$form->{ "$key" . "auf" . "$category" } =
$form->format_amount(
- $myconfig,
- $form->round_amount(
- ($form->{$category}{$key} / $form->{4}{$key} * 100),
- $form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ $myconfig,
+ $form->round_amount(
+ ($form->{$category}{$key} / $form->{4}{$key} * 100),
+ $form->{decimalplaces}
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@ergebnisse) {
$form->{4}{$key} * 100
),
$form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
foreach $item (@ergebnisse) {
$form->{ "$key" . "$item" } =
$form->format_amount($myconfig,
- $form->round_amount($form->{ "$key" . "$item" },
- $form->{decimalplaces}
- ), $form->{decimalplaces}, '0');
+ $form->round_amount($form->{ "$key" . "$item" },
+ $form->{decimalplaces}
+ ),
+ $form->{decimalplaces},
+ '0');
}
}
my $last_period = 0;
my $category = "pos_ustva";
my @categories_cent = qw(51r 511 86r 861 97r 971 93r 931
- 96 66 43 45 53 62 65 67);
+ 96 66 43 45 53 62 65 67);
my @categories_euro = qw(48 51 86 91 97 93 94);
$form->{decimalplaces} *= 1;
# }
#
# }
-
+
#
# Berechnung der USTVA Formularfelder
#
$form->{"86r"} = $form->{"861"};
$form->{"97r"} = $form->{"971"};
$form->{"93r"} = $form->{"931"};
+
#$form->{"96"} = $form->{"94"} * 0.16;
- $form->{"43"} =
+ $form->{"43"} =
$form->{"51r"} + $form->{"86r"} + $form->{"97r"} + $form->{"93r"} +
$form->{"96"};
$form->{"45"} = $form->{"43"};
foreach $item (@categories_cent) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2), 2, '0');
+ $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2),
+ 2, '0');
}
foreach $item (@categories_euro) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0), 0, '0');
+ $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0),
+ 0, '0');
}
$dbh->disconnect;
$elster_land_fa{$FFFF} = $elster_init->{$elster_land}->{$FFFF}->[0];
}
foreach $ffff (sort { $elster_land_fa{$a} cmp $elster_land_fa{$b} }
- keys(%elster_land_fa)) {
+ keys(%elster_land_fa)
+ ) {
print qq|
elsterFAAuswahl.options[$j] = new Option("$elster_land_fa{$ffff} ($ffff)","$ffff");|;
$j++;
print qq|<option value="Auswahl" $checked>hier auswählen...</option>|;
} else {
foreach $ffff (sort { $elster_land_fa{$a} cmp $elster_land_fa{$b} }
- keys(%elster_land_fa)) {
+ keys(%elster_land_fa)
+ ) {
print qq|
<option value="$ffff"|;
$main::lxdebug->leave_sub();
}
-
sub ustva {
$main::lxdebug->enter_sub();
my $last_period = 0;
my $category = "pos_ustva";
- my @categories_cent = qw(511 861 36 80 971 931 98 96 53 74
- 85 65 66 61 62 67 63 64 59 69 39 83
- Z43 Z45 Z53 Z62 Z65 Z67);
-
- my @categories_euro = qw(41 44 49 43 48 51 86 35 77 76 91 97 93
- 95 94 42 60 45 52 73 84);
+ my @categories_cent = qw(511 861 36 80 971 931 98 96 53 74
+ 85 65 66 61 62 67 63 64 59 69 39 83
+ Z43 Z45 Z53 Z62 Z65 Z67);
+
+ my @categories_euro = qw(41 44 49 43 48 51 86 35 77 76 91 97 93
+ 95 94 42 60 45 52 73 84);
$form->{decimalplaces} *= 1;
$form->{"$item"} = 0;
}
-
&get_accounts_ustva($dbh, $last_period, $form->{fromdate}, $form->{todate},
- $form, $category);
-
+ $form, $category);
#
# Berechnung der USTVA Formularfelder
$form->{"86r"} = $form->{"861"};
$form->{"97r"} = $form->{"971"};
$form->{"93r"} = $form->{"931"};
- $form->{"Z43"} = $form->{"511"}+ $form->{"861"} +
- $form->{"36"} + $form->{"80"} +
- $form->{"971"}+ $form->{"931"} +
- $form->{"96"} + $form->{"98"};
+ $form->{"Z43"} =
+ $form->{"511"} + $form->{"861"} + $form->{"36"} + $form->{"80"} +
+ $form->{"971"} + $form->{"931"} + $form->{"96"} + $form->{"98"};
$form->{"Z45"} = $form->{"Z43"};
$form->{"Z53"} = $form->{"Z43"};
- $form->{"Z62"} = $form->{"Z43"}- $form->{"66"} -
- $form->{"61"} - $form->{"62"} -
- $form->{"63"} - $form->{"64"} -
- $form->{"59"};
- $form->{"Z65"} = $form->{"Z62"}- $form->{"69"};
- $form->{"83"} = $form->{"Z65"}- $form->{"39"};
-
+ $form->{"Z62"} =
+ $form->{"Z43"} - $form->{"66"} - $form->{"61"} - $form->{"62"} -
+ $form->{"63"} - $form->{"64"} - $form->{"59"};
+ $form->{"Z65"} = $form->{"Z62"} - $form->{"69"};
+ $form->{"83"} = $form->{"Z65"} - $form->{"39"};
+
foreach $item (@categories_cent) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2), 2, '0');
+ $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2),
+ 2, '0');
}
foreach $item (@categories_euro) {
$form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0), 0, '0');
+ $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0),
+ 0, '0');
}
$dbh->disconnect;
my $where = "1 = 1";
my $glwhere = "";
my $subwhere = "";
- my $ARwhere = "";
- my $arwhere = "";
+ my $ARwhere = "";
+ my $arwhere = "";
my $item;
if ($fromdate) {
if ($todate) {
$where .= " AND ac.transdate <= '$todate'";
- $ARwhere .= " AND acc.transdate <= '$todate'";
+ $ARwhere .= " AND acc.transdate <= '$todate'";
$subwhere .= " AND transdate <= '$todate'";
}
my @accno;
my $accno;
my $ref;
+
#print $query;
my $sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
$main::lxdebug->leave_sub();
}
-
1;
</tr>|;
$form->{selectustva} = "<option>\n";
-
+
%ustva = (35 => $locale->text('UStVA-Nr. 35'),
36 => $locale->text('UStVA-Nr. 36'),
39 => $locale->text('UStVA-Nr. 39'),
84 => $locale->text('UStVA-Nr. 84'),
85 => $locale->text('UStVA-Nr. 85'),
86 => $locale->text('UStVA-Nr. 86 left'),
- 861 => $locale->text('UStVA-Nr. 86 right'),
+ 861 => $locale->text('UStVA-Nr. 86 right'),
91 => $locale->text('UStVA-Nr. 91'),
93 => $locale->text('UStVA-Nr. 93 left'),
- 931 => $locale->text('UStVA-Nr. 93 right'),
+ 931 => $locale->text('UStVA-Nr. 93 right'),
94 => $locale->text('UStVA-Nr. 94'),
95 => $locale->text('UStVA-Nr. 95'),
96 => $locale->text('UStVA-Nr. 96'),
97 => $locale->text('UStVA-Nr. 97 links'),
971 => $locale->text('UStVA-Nr. 97 rechts'),
98 => $locale->text('UStVA-Nr. 98'));
-
+
foreach $item (sort({ $a cmp $b } keys %ustva)) {
if ($item == $form->{pos_ustva}) {
$form->{selectustva} .= "<option value=$item selected>$ustva{$item}\n";
? "<option selected>$item\n"
: "<option>$item\n";
}
-
+
foreach $item (qw(name company address signature)) {
$myconfig{$item} =~ s/\"/"/g;
}
: "<option value=$key>$countrycodes{$key}\n";
}
$countrycodes = "<option>American English\n$countrycodes";
-
+
# use an other input number format than output numberformat
# look at Form.pm, sub parse_amount
- my $ in_numberformat = '';
+ my $in_numberformat = '';
$text1 = qq|value="0">| . $locale->text('equal Outputformat');
$text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
@in_nf = ($text1, $text2);
- foreach $item ( @in_nf ) {
+ foreach $item (@in_nf) {
$in_numberformat .=
- ( substr($item, 7, 1) eq $myconfig{in_numberformat})
+ (substr($item, 7, 1) eq $myconfig{in_numberformat})
? "<option selected $item\n"
: "<option $item\n";
}
-
-
foreach $key (keys %{ $form->{IC} }) {
foreach $accno (sort keys %{ $form->{IC}{$key} }) {
$myconfig{$key} .=
$tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/;
$tax =
qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px">$tax</select></td>|;
- $korrektur_checked = ($form->{"korrektur_$i"}?'checked':'');
+ $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : '');
print qq|
<tr>
$button1 = qq|
<td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
<input type=button name=transdatefrom id="trigger1" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
$button2 = qq|
<td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
<input type=button name=transdateto name=transdateto id="trigger2" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
#write Trigger
<h2 class=confirm>$form->{title}</h2>
<h4>|
- . $locale->text('Are you sure you want to remove the marked entries from the queue?')
+ . $locale->text(
+ 'Are you sure you want to remove the marked entries from the queue?')
. qq|</h4>
<input name=action class=submit type=submit value="|
<th align=right>| . $locale->text('Include in Report') . qq|</th>
<td colspan=3>
<input name=l_subtotal class=checkbox type=checkbox value=Y> |
- . $locale->text('Subtotal')
- . qq|</td>
+ . $locale->text('Subtotal') . qq|</td>
</tr>
</table>
</td>
$button1 = qq|
<td><input name=datepaid id=datepaid size=11 title="$myconfig{dateformat}" value="$form->{datepaid}">
<input type=button name=datepaid id="trigger1" value=|
- . $locale->text('button')
- . qq|></td>
+ . $locale->text('button') . qq|></td>
|;
#write Trigger
<tr>
<th align=right nowrap>| . $locale->text('Amount') . qq|</th>
<td colspan=3><input name=amount size=10 value=|
- . $form->format_amount(\%myconfig, $form->{amount}, 2)
- . qq|></td>
+ . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq|></td>
</tr>
</table>
</td>
for $i (1 .. $form->{rowcount}) {
map {
- $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
+ $form->{"${_}_$i"} =
+ $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
} qw(amount due paid);
$totalamount += $form->{"amount_$i"};
for $i (1 .. $form->{rowcount}) {
map {
- $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
+ $form->{"${_}_$i"} =
+ $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
} qw(amount due paid);
if ($form->{"checked_$i"}) {
## /LINET
if ($form->{db} eq 'customer') {
- #get pricegroup and form it
- $form->get_pricegroup(\%myconfig, { all => 1 });
- $form->{pricegroup} = "$form->{klass}";
- $form->{pricegroup_id} = "$form->{klass}";
+ #get pricegroup and form it
+ $form->get_pricegroup(\%myconfig, { all => 1 });
- if (@{ $form->{all_pricegroup} }) {
+ $form->{pricegroup} = "$form->{klass}";
+ $form->{pricegroup_id} = "$form->{klass}";
- $form->{selectpricegroup} = qq|<option>\n|;
- map {
- $form->{selectpricegroup} .=
- qq|<option value="$_->{id}">$_->{pricegroup}\n|
- } @{ $form->{all_pricegroup} };
- }
+ if (@{ $form->{all_pricegroup} }) {
+
+ $form->{selectpricegroup} = qq|<option>\n|;
+ map {
+ $form->{selectpricegroup} .=
+ qq|<option value="$_->{id}">$_->{pricegroup}\n|
+ } @{ $form->{all_pricegroup} };
+ }
- if ($form->{selectpricegroup}) {
- $form->{selectpricegroup} = $form->unescape($form->{selectpricegroup});
+ if ($form->{selectpricegroup}) {
+ $form->{selectpricegroup} = $form->unescape($form->{selectpricegroup});
- $pricegroup =
- qq|<input type=hidden name=selectpricegroup value="|
- . $form->escape($form->{selectpricegroup}, 1) . qq|">|;
+ $pricegroup =
+ qq|<input type=hidden name=selectpricegroup value="|
+ . $form->escape($form->{selectpricegroup}, 1) . qq|">|;
- $form->{selectpricegroup} =~
- s/(<option value="\Q$form->{klass}\E")/$1 selected/;
+ $form->{selectpricegroup} =~
+ s/(<option value="\Q$form->{klass}\E")/$1 selected/;
- $pricegroup .= qq|<select name=klass>$form->{selectpricegroup}</select>|;
+ $pricegroup .= qq|<select name=klass>$form->{selectpricegroup}</select>|;
+ }
}
- }
+
# $locale->text('Customer Number')
# $locale->text('Vendor Number')
$form->{fokus} = "ct.name";
<th align=right>| . $locale->text('Language') . qq|</th>
<td><select name=language tabindex=23>$lang
</select></td>|;
-if ($form->{db} eq 'customer'){
-print qq|
+ if ($form->{db} eq 'customer') {
+
+ print qq|
<th align=right>| . $locale->text('Preisklasse') . qq|</th>
<td>$pricegroup</td>|;
-}
+ }
print qq| </tr>
<tr>
<td align=right>| . $locale->text('Obsolete') . qq|</td>
</tr>
<tr>
<td><input checked name=kne type=checkbox class=checkbox value=1> |
- . $locale->text("Kontonummernerweiterung (KNE)")
- . qq|</td>
+ . $locale->text("Kontonummernerweiterung (KNE)") . qq|</td>
<td></td>
<td align=left nowrap>| . $locale->text("Abrechnungsnummer") . qq|</td>
</tr>
<tr>
<td><input name=exporttype type=radio class=radio value=0 checked> |
- . $locale->text("Export Buchungsdaten")
- . qq|</td>
+ . $locale->text("Export Buchungsdaten") . qq|</td>
<td></td>
<td><input name=exporttype type=radio class=radio value=1> |
- . $locale->text("Export Stammdaten")
- . qq|</td>
+ . $locale->text("Export Stammdaten") . qq|</td>
<td></td>
</td>
</table>
. $locale->text('January')
. qq|</option>
<option value=2>|
- . $locale->text('February')
- . qq|</option>
+ . $locale->text('February') . qq|</option>
<option value=3>|
- . $locale->text('March')
- . qq|</option>
+ . $locale->text('March') . qq|</option>
<option value=4>|
- . $locale->text('April')
- . qq|</option>
+ . $locale->text('April') . qq|</option>
<option value=5>|
- . $locale->text('May')
- . qq|</option>
+ . $locale->text('May') . qq|</option>
<option value=6>|
- . $locale->text('June')
- . qq|</option>
+ . $locale->text('June') . qq|</option>
<option value=7>|
- . $locale->text('July')
- . qq|</option>
+ . $locale->text('July') . qq|</option>
<option value=8>|
- . $locale->text('August')
- . qq|</option>
+ . $locale->text('August') . qq|</option>
<option value=9>|
- . $locale->text('September')
- . qq|</option>
+ . $locale->text('September') . qq|</option>
<option value=10>|
- . $locale->text('October')
- . qq|</option>
+ . $locale->text('October') . qq|</option>
<option value=11>|
- . $locale->text('November')
- . qq|</option>
+ . $locale->text('November') . qq|</option>
<option value=12>|
- . $locale->text('December')
- . qq|</option>|;
+ . $locale->text('December') . qq|</option>|;
$form->{allequartale} =
qq|<option selected value=1>|
. qq|</option>
<option value=2>| . $locale->text('II') . qq|</option>
<option value=3>|
- . $locale->text('III')
- . qq|</option>
+ . $locale->text('III') . qq|</option>
<option value=4>|
- . $locale->text('IV')
- . qq|</option>|;
+ . $locale->text('IV') . qq|</option>|;
$form->header;
print qq|
<table>
<tr>
<td align=left><input checked name=zeitraum class=radio type=radio value=monat> </td><td align=left>|
- . $locale->text('Monat')
- . qq|</td>
+ . $locale->text('Monat') . qq|</td>
<td align=left></td>
<td align=left></td>
<td align=left><select name=monat>$form->{allemonate}</select></td>
</tr>
<tr>
<td align=left><input name=zeitraum class=radio type=radio value=quartal> </td><td align=left>|
- . $locale->text('Quartal')
- . qq|</td>
+ . $locale->text('Quartal') . qq|</td>
<td align=left></td>
<td align=left></td>
<td align=left><select name=quartal>$form->{allequartale}</select></td>
</tr>
<tr>
<td align=left><input name=zeitraum class=radio type=radio value=zeit> </td><td align=left>|
- . $locale->text('Datum von')
- . qq|</td>
+ . $locale->text('Datum von') . qq|</td>
<td align=left><input name=transdatefrom size=8></td>
<td align=left>| . $locale->text('bis') . qq|</td>
<td align=left><input name=transdateto size=8></td>
</tr>
|;
}
- $form->{balance} *= $ml;
+ $form->{balance} *= $ml;
foreach $ref (@{ $form->{GL} }) {
$form->{balance} *= $ml;
+
# if item ne sort print subtotal
if ($form->{l_subtotal} eq 'Y') {
if ($sameitem ne $ref->{ $form->{sort} }) {
&gl_subtotal;
}
}
+
#foreach $key (sort keys(%{ $ref->{amount} })) {
# $form->{balance} += $ref->{amount}{$key};
#}
$credit .= "<br>"
. $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0);
}
- $form->{balance} = abs($form->{balance}) - abs( $ref->{credit}{$key});
+ $form->{balance} = abs($form->{balance}) - abs($ref->{credit}{$key});
}
$debittax = "";
$debitaccno .=
"<br><a href=$href&accno=$ref->{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}</a>";
}
-# if ($ref->{debit_taxkey}{$key} eq $debittaxkey) {
-# $ref->{debit_tax_accno}{$key} = $taxaccno;
-# }
+
+ # if ($ref->{debit_taxkey}{$key} eq $debittaxkey) {
+ # $ref->{debit_tax_accno}{$key} = $taxaccno;
+ # }
$taxaccno = $ref->{debit_tax_accno}{$key};
$debittaxkey = $ref->{debit_taxkey}{$key};
}
$creditaccno .=
"<br><a href=$href&accno=$ref->{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}</a>";
}
-# if ($ref->{credit_taxkey}{$key} eq $credittaxkey) {
-# $ref->{credit_tax_accno}{$key} = $taxaccno;
-# }
+
+ # if ($ref->{credit_taxkey}{$key} eq $credittaxkey) {
+ # $ref->{credit_tax_accno}{$key} = $taxaccno;
+ # }
$taxaccno = $ref->{credit_tax_accno}{$key};
$credittaxkey = $ref->{credit_taxkey}{$key};
}
$column_data{gifi_accno} =
"<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>";
$column_data{balance} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $form->{balance}, 2, 0)
- . "</td>";
+ "<td align=right>"
+ . $form->format_amount(\%myconfig, $form->{balance}, 2, 0) . "</td>";
$i++;
$i %= 2;
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:200px" tabindex=|
. ($i + 5 + (($i - 1) * 8)) . qq|>$form->{chartinit}</select></td>|;
$tax =
- qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px" tabindex=|
+ qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px" tabindex=|
. ($i + 10 + (($i - 1) * 8))
. qq|>$form->{taxchart}</select></td>|;
-# if ($form->{selectprojectnumber}) {
-# $project = qq|
-# <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
-# }
+
+ # if ($form->{selectprojectnumber}) {
+ # $project = qq|
+ # <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
+ # }
$korrektur =
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
. ($i + 9 + (($i - 1) * 8))
. ($i + 10 + (($i - 1) * 8))
. qq|>$tax</select></td>|;
-# if ($form->{selectprojectnumber}) {
-# $form->{"projectnumber_$i"} = ""
-# if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
-#
-# $project = $form->{"projectnumber_$i"};
-# $project =~ s/--.*//;
-# $project = qq|<td>$project</td>|;
-# }
+ # if ($form->{selectprojectnumber}) {
+ # $form->{"projectnumber_$i"} = ""
+ # if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
+ #
+ # $project = $form->{"projectnumber_$i"};
+ # $project =~ s/--.*//;
+ # $project = qq|<td>$project</td>|;
+ # }
if ($form->{transfer}) {
$checked = ($form->{"fx_transaction_$i"}) ? "1" : "";
$tax = qq|
<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
. ($i + 10 + (($i - 1) * 8)) . qq|>$taxchart</select></td>|;
-# if ($form->{selectprojectnumber}) {
-# $project = qq|
-# <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
-# }
+
+ # if ($form->{selectprojectnumber}) {
+ # $project = qq|
+ # <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
+ # }
$korrektur =
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
. ($i + 9 + (($i - 1) * 8))
}
$form->hide_form(qw(rowcount selectaccno));
-# print qq|
-# <input type=hidden name=selectprojectnumber value="|
-# . $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
+
+ # print qq|
+ # <input type=hidden name=selectprojectnumber value="|
+ # . $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
$lxdebug->leave_sub();
}
unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
if ($form->{"debit_$i"} ne "") {
$form->{"credit_$i"} = $form->{"debit_$i"};
- $form->{"debit_$i"} = "";
+ $form->{"debit_$i"} = "";
} elsif ($form->{"credit_$i"} ne "") {
- $form->{"debit_$i"} = $form->{"credit_$i"};
+ $form->{"debit_$i"} = $form->{"credit_$i"};
$form->{"credit_$i"} = "";
}
}
#$locale->text('ea');
use SL::IC;
+
#use SL::PE;
require "$form->{path}/io.pl";
$lxdebug->enter_sub();
my $dec = '';
-
+
#decimalplaces for listprice
($dec) = ($form->{listprice} =~ /\.(\d+)/);
$dec = length $dec;
# $locale->text('Assembly Number missing!')
# save part
- $lxdebug->message(LXDebug::DEBUG1, "ic.pl: sellprice in save = $form->{sellprice}\n");
+ $lxdebug->message(LXDebug::DEBUG1,
+ "ic.pl: sellprice in save = $form->{sellprice}\n");
$rc = IC->save(\%myconfig, \%$form);
if ($rc == 3) {
$form->error($locale->text('Partnumber not unique!'));
if ($form->{exchangerate} != 0) {
$form->{"sellprice_$i"} /= $form->{exchangerate};
}
- $lxdebug->message(LXDebug::DEBUG1, qq|sellprice_$i in previousform 2 = |.$form->{"sellprice_$i"}.qq|\n|);
+ $lxdebug->message(LXDebug::DEBUG1,
+ qq|sellprice_$i in previousform 2 = |
+ . $form->{"sellprice_$i"} . qq|\n|);
map { $form->{"taxaccounts_$i"} .= "$_ " } split / /,
$newform{taxaccount};
chop $form->{"taxaccounts_$i"};
$form->{creditremaining} -= $amount;
- # redo number formatting, because invoice parse them!
- $i = $form->{rowcount};
- map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}) }
- qw(weight listprice sellprice rop);
+ # redo number formatting, because invoice parse them!
+ $i = $form->{rowcount};
+ map {
+ $form->{"${_}_$i"} =
+ $form->format_amount(\%myconfig, $form->{"${_}_$i"})
+ } qw(weight listprice sellprice rop);
}
$form->{"id_$i"} = $parts_id;
}
$form->{callback} = $callback;
}
- $lxdebug->message(LXDebug::DEBUG1, qq|ic.pl: sellprice_$i nach sub save = |.$form->{"sellprice_$i"}.qq|\n|);
+ $lxdebug->message(LXDebug::DEBUG1,
+ qq|ic.pl: sellprice_$i nach sub save = |
+ . $form->{"sellprice_$i"} . qq|\n|);
+
# redirect
$form->redirect;
<input type=hidden name="project_id_$i" value="$form->{"project_id_$i"}">
|;
if ($form->{type} eq 'invoice' or $form->{type} =~ /order/) {
- my $reqdate_term = ($form->{type} eq 'invoice')?'deliverydate':'reqdate'; # invoice uses a different term for the same thing.
+ my $reqdate_term =
+ ($form->{type} eq 'invoice')
+ ? 'deliverydate'
+ : 'reqdate'; # invoice uses a different term for the same thing.
print qq|
<b>${$reqdate_term}</b> <input name="${reqdate_term}_$i" size=11 value="$form->{"${reqdate_term}_$i"}">
|;
$prices = '';
$price = 0;
foreach $item (@{ $form->{PRICES}{$j} }) {
+
#$price = $form->round_amount($myconfig, $item->{price}, 5);
#$price = $form->format_amount($myconfig, $item->{price}, 2);
- $price = $item->{price};
+ $price = $item->{price};
$pricegroup_id = $item->{pricegroup_id};
$pricegroup = $item->{pricegroup};
qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|;
$len += 1;
-# map {
-# $form->{"${_}_$j"} =
-# $form->format_amount(\%myconfig, $form->{"${_}_$j"})
-# } qw(sellprice price_new price_old);
+
+ # map {
+ # $form->{"${_}_$j"} =
+ # $form->format_amount(\%myconfig, $form->{"${_}_$j"})
+ # } qw(sellprice price_new price_old);
# set new selectedpricegroup_id and prices for "Preis"
if ($item->{selected} && ($pricegroup_id != 0)) {
&{"$form->{display_form}"};
exit;
}
-# if ( $form->{print_and_post}
-# && $form->{second_run}
-# && ($form->{action} eq "display_form")) {
-# for (keys %$form) { $old_form->{$_} = $form->{$_} }
-# $old_form->{rowcount}++;
-#
-# #$form->{rowcount}--;
-# #$form->{rowcount}--;
-#
-# $form->{print_and_post} = 0;
-#
-# &print_form($old_form);
-# exit;
-# }
-#
-# $form->{action} = "";
-# $form->{resubmit} = 0;
-#
-# if ($form->{print_and_post} && !$form->{second_run}) {
-# $form->{second_run} = 1;
-# $form->{action} = "display_form";
-# $form->{rowcount}--;
-# my $rowcount = $form->{rowcount};
-#
-# # get pricegroups for parts
-# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
-#
-# # build up html code for prices_$i
-# set_pricegroup($rowcount);
-#
-# $form->{resubmit} = 1;
-#
-# }
+
+ # if ( $form->{print_and_post}
+ # && $form->{second_run}
+ # && ($form->{action} eq "display_form")) {
+ # for (keys %$form) { $old_form->{$_} = $form->{$_} }
+ # $old_form->{rowcount}++;
+ #
+ # #$form->{rowcount}--;
+ # #$form->{rowcount}--;
+ #
+ # $form->{print_and_post} = 0;
+ #
+ # &print_form($old_form);
+ # exit;
+ # }
+ #
+ # $form->{action} = "";
+ # $form->{resubmit} = 0;
+ #
+ # if ($form->{print_and_post} && !$form->{second_run}) {
+ # $form->{second_run} = 1;
+ # $form->{action} = "display_form";
+ # $form->{rowcount}--;
+ # my $rowcount = $form->{rowcount};
+ #
+ # # get pricegroups for parts
+ # IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+ #
+ # # build up html code for prices_$i
+ # set_pricegroup($rowcount);
+ #
+ # $form->{resubmit} = 1;
+ #
+ # }
&form_header;
$numrows = ++$form->{rowcount};
$form->{DF}{ $form->{format} } = "selected";
$form->{OP}{ $form->{media} } = "selected";
$form->{SM}{ $form->{sendmode} } = "selected";
-
+
if ($form->{type} eq 'purchase_order') {
$type = qq|<select name=formname>
<option value=purchase_order $form->{PD}{purchase_order}>|
sub print {
$lxdebug->enter_sub();
-
# if this goes to the printer pass through
if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
$form->error($locale->text('Select postscript or PDF!'))
IS->invoice_details(\%myconfig, \%$form, $locale);
}
- # format global dates
+ # format global dates
map { $form->{$_} = $locale->date(\%myconfig, $form->{$_}, 1) }
("${inv}date", "${due}date", "shippingdate", "deliverydate");
# format item dates
for my $field (qw(transdate_oe deliverydate_oe)) {
- map {
- $form->{$field}[$_] = $locale->date(\%myconfig, $form->{$field}[$_], 1);
- } 0..$#{$form->{$field}};
+ map {
+ $form->{$field}[$_] = $locale->date(\%myconfig, $form->{$field}[$_], 1);
+ } 0 .. $#{ $form->{$field} };
}
@a = qw(name street zipcode city country);
}
&invoice_links;
&prepare_invoice;
- $form->{format} ="pdf";
+ $form->{format} = "pdf";
&display_form;
$form->error("Access Denied");
}
if ($form->{print_and_post}) {
- $form->{action} = "print";
+ $form->{action} = "print";
$form->{resubmit} = 1;
}
&invoice_links;
#write Trigger
$jsscript =
- Form->write_trigger(\%myconfig, "3", "invdate", "BL", "trigger1",
- "duedate", "BL", "trigger2",
- "deliverydate", "BL", "trigger3");
+ Form->write_trigger(\%myconfig, "3",
+ "invdate", "BL",
+ "trigger1", "duedate",
+ "BL", "trigger2",
+ "deliverydate", "BL",
+ "trigger3");
} else {
# without JavaScript Calendar
qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
}
if ($form->{resubmit} && ($form->{format} eq "html")) {
- $onload = qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
- } elsif($form->{resubmit}) {
+ $onload =
+ qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
+ } elsif ($form->{resubmit}) {
$onload = qq|document.invoice.submit()|;
} else {
$onload = "fokus()";
# get new invnumber in sequence if no invnumber is given or if posasnew was requested
if (!$form->{invnumber} || $form->{postasnew}) {
- $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber")
+ $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber");
}
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
<table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
- . $login
- . $datum
- . qq| <script>writeclock()</script>
+ . $login . $datum . qq| <script>writeclock()</script>
</td>
</tr>
</table>
<table width=100%>
<tr>
<th class=listtop colspan=5>|
- . $locale->text('Select from one of the items below')
- . qq|</th>
+ . $locale->text('Select from one of the items below') . qq|</th>
</tr>
<tr height="5"></tr>
<tr class=listheading>
qq|<tr class=listrow$j>
<td><input name=ndx class=radio type=radio value=$i $checked></td>
<td><input name=\"new_partnumber_$i\" type=hidden value=\"|
- . $p{"partnumber"} . qq|\">|
- . $p{"partnumber"}
- . qq|</td>
+ . $p{"partnumber"} . qq|\">| . $p{"partnumber"} . qq|</td>
<td><input name=\"new_description_$i\" type=hidden value=\"|
- . $p{"description"} . qq|\">|
- . $p{"description"}
- . qq|</td>
+ . $p{"description"} . qq|\">| . $p{"description"} . qq|</td>
<input name=\"new_parts_id_$i\" type=hidden value=\"| . $p{"id"} . qq|\">
</tr>|);
<table width=100%>
<tr>
<th class=listtop colspan=5>|
- . $locale->text('Select from one of the names below')
- . qq|</th>
+ . $locale->text('Select from one of the names below') . qq|</th>
</tr>
<tr height="5"></tr>
<tr class=listheading>
qq|<tr class=listrow$j>
<td><input name=ndx class=radio type=radio value=$i $checked></td>
<td><input name=\"new_customer_id_$i\" type=hidden value=\"|
- . $c{"id"}
- . qq|\">$c{"customernumber"}</td>
+ . $c{"id"} . qq|\">$c{"customernumber"}</td>
<td><input name=\"new_customer_name_$i\" type=hidden value=\"|
- . $c{"name"}
- . qq|\">$c{"name"}</td>
+ . $c{"name"} . qq|\">$c{"name"}</td>
<td>$c{"street"}</td>
<td>$c{"zipcode"}</td>
<td>$c{"city"}</td>
<tr>
<th align=right>| . $locale->text('Part Number') . qq|</th>
<td><input name=partnumber value=\"|
- . quot($form->{"partnumber"})
- . qq|\"></td>
+ . quot($form->{"partnumber"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('Description') . qq|</th>
<td><input name=description value=\"|
- . quot($form->{"description"})
- . qq|\"></td>
+ . quot($form->{"description"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('Company Name') . qq|</th>|);
<tr>
<th align=right>| . $locale->text('Comment') . qq|</th>
<td><input name=comment value=\"|
- . quot($form->{"comment"})
- . qq|\"></td>
+ . quot($form->{"comment"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('Valid until') . qq|</th>
<td><input name=validuntil value=\"|
- . quot($form->{"validuntil"})
- . qq|\"></td>
+ . quot($form->{"validuntil"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('Quantity') . qq|</th>
<td><input name=quantity value=\"|
- . quot($form->{"quantity"})
- . qq|\"></td>
+ . quot($form->{"quantity"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('License key') . qq|</th>
<td><input name=licensenumber value=\"|
- . quot($form->{"licensenumber"})
- . qq|\"></td>
+ . quot($form->{"licensenumber"}) . qq|\"></td>
</tr>
<tr>
<th align=right>| . $locale->text('Own Product') . qq|</th>
print(
qq|
<input type=submit name=action value=\"|
- . $locale->text('Save')
- . qq|\">\n|);
+ . $locale->text('Save') . qq|\">\n|);
}
print(
qq|
$lxdebug->enter_sub();
if (!$lizenzen) {
$form->error(
- $locale->text('The licensing module has been deactivated in lx-erp.conf.')
+ $locale->text(
+ 'The licensing module has been deactivated in lx-erp.conf.')
);
}
. $locale->text('Expiring in x month(s)')
. qq| <input size=4 name=expiring_in value="1"><br>
<input type=checkbox name=show_expired value=1>|
- . $locale->text('Expired licenses')
- . qq|</td>
+ . $locale->text('Expired licenses') . qq|</td>
</tr>
</table>
</tr>
|);
if (scalar(@{ $form->{"licenses"} }) == 0) {
print(qq|</table>|
- . $locale->text("No licenses were found that match the search criteria.")
+ . $locale->text(
+ "No licenses were found that match the search criteria.")
. qq|</body></html>|);
exit(0);
}
. $locale->text('Description')
. qq|</a></th>
<th class=listtop><a class=listheading href=\"|
- . $columns{"name"} . "\">"
- . $locale->text('Company Name')
- . qq|</a></th>
+ . $columns{"name"} . "\">" . $locale->text('Company Name') . qq|</a></th>
<th class=listtop><a class=listheading href=\"|
. $columns{"validuntil"} . "\">"
. $locale->text('Valid until')
<table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
- . $login
- . $datum
- . qq| <script>writeclock()</script>
+ . $login . $datum . qq| <script>writeclock()</script>
</td>
</tr>
</table>
# editing without stuff to edit? try adding it first
if ($form->{rowcount}) {
- map {$id++ if $form->{"id_$_"}} (1 .. $form->{rowcount});
+ map { $id++ if $form->{"id_$_"} } (1 .. $form->{rowcount});
if (!$id) {
+
# reset rowcount
undef $form->{rowcount};
&add;
# retrieve order/quotation
$form->{webdav} = $webdav;
-
# set jscalendar
$form->{jscalendar} = $jscalendar;
OE->retrieve(\%myconfig, \%$form);
# if multiple rowcounts (== collective order) then check if the
- # there were more than one customer (in that case OE::retrieve removes
+ # there were more than one customer (in that case OE::retrieve removes
# the content from the field)
- if ($form->{rowcount} && $form->{type} eq 'sales_order' && defined $form->{customer} && $form->{customer} eq '') {
-# $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
- $form->error($locale->text('Collective Orders only work for orders from one customer!'));
+ if ( $form->{rowcount}
+ && $form->{type} eq 'sales_order'
+ && defined $form->{customer}
+ && $form->{customer} eq '') {
+
+ # $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
+ $form->error(
+ $locale->text(
+ 'Collective Orders only work for orders from one customer!')
+ );
}
$taxincluded = $form->{taxincluded};
$form->{media} = "screen";
$form->{formname} = $form->{type};
- map { $form->{$_} =~ s/\"/"/g }
- qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact);
+ map { $form->{$_} =~ s/\"/"/g }
+ qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact);
- foreach $ref (@{ $form->{form_details} }) {
- $form->{rowcount} = ++$i;
+ foreach $ref (@{ $form->{form_details} }) {
+ $form->{rowcount} = ++$i;
- map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
- }
- for my $i (1 .. $form->{rowcount}) {
- if ($form->{id}) {
- $form->{"discount_$i"} =
- $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
- } else {
- $form->{"discount_$i"} =
- $form->format_amount(\%myconfig, $form->{"discount_$i"});
- }
- ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
- $dec = length $dec;
- $decimalplaces = ($dec > 2) ? $dec : 2;
-
- # copy reqdate from deliverydate for invoice -> order conversion
- $form->{"reqdate_$i"} = $form->{"deliverydate_$i"} unless $form->{"reqdate_$i"};
-
- $form->{"sellprice_$i"} =
- $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
- $decimalplaces);
-
- (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
- $dec_qty = length $dec_qty;
- $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
-
- map { $form->{"${_}_$i"} =~ s/\"/"/g }
- qw(partnumber description unit);
+ map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
+ }
+ for my $i (1 .. $form->{rowcount}) {
+ if ($form->{id}) {
+ $form->{"discount_$i"} =
+ $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+ } else {
+ $form->{"discount_$i"} =
+ $form->format_amount(\%myconfig, $form->{"discount_$i"});
}
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ # copy reqdate from deliverydate for invoice -> order conversion
+ $form->{"reqdate_$i"} = $form->{"deliverydate_$i"}
+ unless $form->{"reqdate_$i"};
+
+ $form->{"sellprice_$i"} =
+ $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
+ $decimalplaces);
+
+ (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
+ $dec_qty = length $dec_qty;
+ $form->{"qty_$i"} =
+ $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
+
+ map { $form->{"${_}_$i"} =~ s/\"/"/g }
+ qw(partnumber description unit);
+ }
$lxdebug->leave_sub();
}
. $locale->text('Invoice') . qq|">
|;
}
-
if ($form->{menubar}) {
require "$form->{path}/menu.pl";
} else {
$form->{"sellprice_$i"} *= (1 - $form->{tradediscount});
+
# if there is an exchange rate adjust sellprice
$form->{"sellprice_$i"} /= $exchangerate;
}
}
}
-
$lxdebug->leave_sub();
}
$subtotalnetamount += $oe->{netamount};
$subtotalamount += $oe->{amount};
- $column_data{ids} = qq|<td><input name="id_$j" class=checkbox type=checkbox><input type="hidden" name="trans_id_$j" value="$oe->{id}"></td>|;
+ $column_data{ids} =
+ qq|<td><input name="id_$j" class=checkbox type=checkbox><input type="hidden" name="trans_id_$j" value="$oe->{id}"></td>|;
$column_data{id} = "<td>$oe->{id}</td>";
$column_data{transdate} = "<td>$oe->{transdate} </td>";
$column_data{reqdate} = "<td>$oe->{reqdate} </td>";
</tr>
</table>|;
-# multiple invoice edit button only if gotten there via sales_order form.
+ # multiple invoice edit button only if gotten there via sales_order form.
-if ($form->{type} =~ /sales_order/) {
-print qq|
+ if ($form->{type} =~ /sales_order/) {
+ print qq|
<input type="hidden" name="path" value="$form->{path}">
<input class"submit" type="submit" name="action" value="|
-. $locale->text('Continue') .qq|">
+ . $locale->text('Continue') . qq|">
<input type="hidden" name="nextsub" value="edit">
<input type="hidden" name="type" value="$form->{type}">
<input type="hidden" name="warehouse" value="$warehouse">
<input type="hidden" name="password" value="$form->{password}">
<input type="hidden" name="callback" value="$callback">
<input type="hidden" name="rowcount" value="$form->{rowcount}">|;
-}
+ }
-print qq|
+ print qq|
</form>
<br>
$lxdebug->enter_sub();
if ($form->{type} =~ /_order$/) {
+
# these checks only apply if the items don't bring their own ordnumbers/transdates.
# The if clause ensures that by searching for empty ordnumber_#/transdate_# fields.
- $form->isblank("ordnumber", $locale->text('Order Number missing!')) if ( +{ map { $form->{"ordnumber_$_"}, 1 } ( 1 .. $form->{rowcount}-1 ) }->{''} );
- $form->isblank("transdate", $locale->text('Order Date missing!')) if ( +{ map { $form->{"transdate_$_"}, 1 } ( 1 .. $form->{rowcount}-1 ) }->{''} );
+ $form->isblank("ordnumber", $locale->text('Order Number missing!'))
+ if (+{ map { $form->{"ordnumber_$_"}, 1 } (1 .. $form->{rowcount} - 1) }
+ ->{''});
+ $form->isblank("transdate", $locale->text('Order Date missing!'))
+ if (+{ map { $form->{"transdate_$_"}, 1 } (1 .. $form->{rowcount} - 1) }
+ ->{''});
# also copy deliverydate from the order
$form->{deliverydate} = $form->{reqdate} if $form->{reqdate};
# close orders/quotations
$form->{closed} = 1;
- # save order if one ordnumber has been given
+ # save order if one ordnumber has been given
# if not it's most likely a collective order, which can't be saved back
# so they just have to be closed
if (($form->{ordnumber} ne '') || ($form->{quonumber} ne '')) {
$decimalplaces = ($dec > 2) ? $dec : 2;
# copy delivery date from reqdate for order -> invoice conversion
- $form->{"deliverydate_$i"} = $form->{"reqdate_$i"} unless $form->{"deliverydate_$i"};
+ $form->{"deliverydate_$i"} = $form->{"reqdate_$i"}
+ unless $form->{"deliverydate_$i"};
$form->{"sellprice_$i"} =
$form->format_amount(\%myconfig, $form->{"sellprice_$i"},
$decimalplaces);
-
+
(my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
- $dec_qty = length $dec_qty;
- $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
+ $dec_qty = length $dec_qty;
+ $form->{"qty_$i"} =
+ $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
map { $form->{"${_}_$i"} =~ s/\"/"/g }
qw(partnumber description unit);
$clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
if ($fx) {
- $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
+ $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
$exchdiff = qq|
<th align=right nowrap>|
- . $locale->text('Exchangerate Difference')
- . qq|</th>
+ . $locale->text('Exchangerate Difference') . qq|</th>
<td width=10%></td>
<td align=right>$fx</td>
|;
<td><input name=l_heading class=checkbox type=checkbox value=Y> |
. $locale->text('Heading') . qq|
<input name=l_subtotal class=checkbox type=checkbox value=Y> |
- . $locale->text('Subtotal')
- . qq|</td>
+ . $locale->text('Subtotal') . qq|</td>
</tr>
$jsscript
<table>
<tr>
<th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Customized Report')
- . qq|</th>
+ . $locale->text('Customized Report') . qq|</th>
</tr>
<tr>
<th colspan=1>| . $locale->text('Year') . qq|</th>
<td><input name=year size=11 title="|
- . $locale->text('YYYY')
- . qq|" value="$year"></td>
+ . $locale->text('YYYY') . qq|" value="$year"></td>
</tr>
|;
<td align=right> <input name=duetyp class=radio type=radio value="13"
"checked"></td>
<td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
|;
$checked = "";
print qq|
<td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January')
- . qq|</td>
+ . $locale->text('January') . qq|</td>
|;
$checked = "";
print qq|
<td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May')
- . qq|</td>
+ . $locale->text('May') . qq|</td>
<td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September')
- . qq|</td>
+ . $locale->text('September') . qq|</td>
</tr>
<tr>
<td align= right> </td>
<td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February')
- . qq|</td>
+ . $locale->text('February') . qq|</td>
<td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June')
- . qq|</td>
+ . $locale->text('June') . qq|</td>
<td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October')
- . qq|</td>
+ . $locale->text('October') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March')
- . qq|</td>
+ . $locale->text('March') . qq|</td>
<td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July')
- . qq|</td>
+ . $locale->text('July') . qq|</td>
<td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November')
- . qq|</td>
+ . $locale->text('November') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter')
- . qq| </td>
+ . $locale->text('Quarter') . qq| </td>
<td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April')
- . qq|</td>
+ . $locale->text('April') . qq|</td>
<td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August')
- . qq|</td>
+ . $locale->text('August') . qq|</td>
<td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December')
- . qq|</td>
+ . $locale->text('December') . qq|</td>
</tr>
<tr>
</tr>
<tr>
<th align=left><input name=reporttype class=radio type=radio value="free" $checked> |
- . $locale->text('Free report period')
- . qq|</th>
+ . $locale->text('Free report period') . qq|</th>
<td align=left colspan=4>| . $locale->text('From') . qq|
$button1
$button1_2
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
$jsscript
<table>
<tr>
<th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Customized Report')
- . qq|</th>
+ . $locale->text('Customized Report') . qq|</th>
</tr>
<tr>
<th colspan=1>| . $locale->text('Year') . qq|</th>
<td><input name=year size=11 title="|
- . $locale->text('YYYY')
- . qq|" value="$year"></td>
+ . $locale->text('YYYY') . qq|" value="$year"></td>
</tr>
|;
<td align=right> <input name=duetyp class=radio type=radio value="13"
$checked></td>
<td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
|;
$checked = "checked";
print qq|
<td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January')
- . qq|</td>
+ . $locale->text('January') . qq|</td>
|;
$checked = "";
print qq|
<td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May')
- . qq|</td>
+ . $locale->text('May') . qq|</td>
<td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September')
- . qq|</td>
+ . $locale->text('September') . qq|</td>
</tr>
<tr>
<td align= right> </td>
<td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February')
- . qq|</td>
+ . $locale->text('February') . qq|</td>
<td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June')
- . qq|</td>
+ . $locale->text('June') . qq|</td>
<td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October')
- . qq|</td>
+ . $locale->text('October') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March')
- . qq|</td>
+ . $locale->text('March') . qq|</td>
<td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July')
- . qq|</td>
+ . $locale->text('July') . qq|</td>
<td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November')
- . qq|</td>
+ . $locale->text('November') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter')
- . qq| </td>
+ . $locale->text('Quarter') . qq| </td>
<td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April')
- . qq|</td>
+ . $locale->text('April') . qq|</td>
<td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August')
- . qq|</td>
+ . $locale->text('August') . qq|</td>
<td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December')
- . qq|</td>
+ . $locale->text('December') . qq|</td>
</tr>
<tr>
</tr>
<tr>
<th align=left><input name=reporttype class=radio type=radio value="free" $checked> |
- . $locale->text('Free report period')
- . qq|</th>
+ . $locale->text('Free report period') . qq|</th>
<td align=left colspan=4>| . $locale->text('From') . qq|
$button1
$button1_2
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
<tr>
- <th align=right colspan=4>| . $locale->text('Decimalplaces') . qq|</th>
+ <th align=right colspan=4>|
+ . $locale->text('Decimalplaces')
+ . qq|</th>
<td><input name=decimalplaces size=3></td>
</tr>
<table>
<tr>
<th align=left><input name=reporttype class=radio type=radio value="custom" checked> |
- . $locale->text('Zeitraum')
- . qq|</th>
+ . $locale->text('Zeitraum') . qq|</th>
</tr>
<tr>
<th colspan=1>| . $locale->text('Year') . qq|</th>
<td><input name=year size=11 title="|
- . $locale->text('YYYY')
- . qq|" value="$year"></td>
+ . $locale->text('YYYY') . qq|" value="$year"></td>
</tr>
|;
<td align=right> <input name=duetyp class=radio type=radio value="13"
$checked></td>
<td><input name=duetyp class=radio type=radio value="A" $checked > 1. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
|;
$checked = "checked";
print qq|
<td><input name=duetyp class=radio type=radio value="1" $checked > |
- . $locale->text('January')
- . qq|</td>
+ . $locale->text('January') . qq|</td>
|;
$checked = "";
print qq|
<td><input name=duetyp class=radio type=radio value="5" $checked > |
- . $locale->text('May')
- . qq|</td>
+ . $locale->text('May') . qq|</td>
<td><input name=duetyp class=radio type=radio value="9" $checked > |
- . $locale->text('September')
- . qq|</td>
+ . $locale->text('September') . qq|</td>
</tr>
<tr>
<td align= right> </td>
<td><input name=duetyp class=radio type=radio value="B" $checked> 2. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="2" $checked > |
- . $locale->text('February')
- . qq|</td>
+ . $locale->text('February') . qq|</td>
<td><input name=duetyp class=radio type=radio value="6" $checked > |
- . $locale->text('June')
- . qq|</td>
+ . $locale->text('June') . qq|</td>
<td><input name=duetyp class=radio type=radio value="10" $checked > |
- . $locale->text('October')
- . qq|</td>
+ . $locale->text('October') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="C" $checked> 3. |
- . $locale->text('Quarter')
- . qq|</td>
+ . $locale->text('Quarter') . qq|</td>
<td><input name=duetyp class=radio type=radio value="3" $checked > |
- . $locale->text('March')
- . qq|</td>
+ . $locale->text('March') . qq|</td>
<td><input name=duetyp class=radio type=radio value="7" $checked > |
- . $locale->text('July')
- . qq|</td>
+ . $locale->text('July') . qq|</td>
<td><input name=duetyp class=radio type=radio value="11" $checked > |
- . $locale->text('November')
- . qq|</td>
+ . $locale->text('November') . qq|</td>
</tr>
<tr>
<td> </td>
<td><input name=duetyp class=radio type=radio value="D" $checked> 4. |
- . $locale->text('Quarter')
- . qq| </td>
+ . $locale->text('Quarter') . qq| </td>
<td><input name=duetyp class=radio type=radio value="4" $checked > |
- . $locale->text('April')
- . qq|</td>
+ . $locale->text('April') . qq|</td>
<td><input name=duetyp class=radio type=radio value="8" $checked > |
- . $locale->text('August')
- . qq|</td>
+ . $locale->text('August') . qq|</td>
<td><input name=duetyp class=radio type=radio value="12" $checked > |
- . $locale->text('December')
- . qq|</td>
+ . $locale->text('December') . qq|</td>
</tr>
<tr>
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
<tr>
<th colspan=4>|;
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
<tr>
<input name=l_subtotal class=checkbox type=checkbox value=Y> |
. $locale->text('Subtotal') . qq|
<input name=l_accno class=checkbox type=checkbox value=Y> |
- . $locale->text('Account Number')
- . qq|</td>
+ . $locale->text('Account Number') . qq|</td>
</tr>
$jsscript
<input name=l_subtotal class=checkbox type=checkbox value=Y> |
. $locale->text('Subtotal') . qq|
<input name=all_accounts class=checkbox type=checkbox value=Y> |
- . $locale->text('All Accounts')
- . qq|</td>
+ . $locale->text('All Accounts') . qq|</td>
</tr>
$jsscript
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
</table>
</td>
<td colspan=3><input name=method class=radio type=radio value=accrual $accrual>|
. $locale->text('Accrual') . qq|
<input name=method class=radio type=radio value=cash $cash>|
- . $locale->text('EUR')
- . qq|</td>
+ . $locale->text('EUR') . qq|</td>
</tr>
<tr>
<th align=right>| . $locale->text('Include in Report') . qq|</th>
<tr>
<td align=right><input type=checkbox style=checkbox name=fx_transaction value=1 checked></td>
<th align=left colspan=3>|
- . $locale->text('Include Exchangerate Difference')
- . qq|</td>
+ . $locale->text('Include Exchangerate Difference') . qq|</td>
</tr>
$jsscript
$form->{title} = $locale->text('UStVA');
$form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1
- my $year = substr($form->datetonum($form->current_date(\%myconfig), \%myconfig),0,4);
+ my $year = substr(
+ $form->datetonum($form->current_date(\%myconfig),
+ \%myconfig
+ ),
+ 0, 4);
my $department = '';
local $hide = '';
# Hier Aufruf von get_config aus bin/mozilla/fa.pl zum
# Einlesen der Finanzamtdaten
&get_config($userspath, 'finanzamt.ini');
-
+
# Hier Einlesen der user-config
# steuernummer entfernt für prerelease
my @a = qw(signature name company address businessnumber tel fax email
| . $locale->text('Kein Firmenname hinterlegt!') . qq|</a><br>
|;
}
-
+
# Anpassungen der Variablennamen auf pre 2.1.1 Namen
# klären, ob $form->{company_street|_address} gesetzt sind
#
($form->{co_street}, $form->{co_city}) = split("<br \/>", $temp);
}
- if ( $form->{co_street} ne ''
- and ($form->{co_zip} ne ''
- or $form->{co_city} ne '') ) {
+ if ($form->{co_street} ne ''
+ and ( $form->{co_zip} ne ''
+ or $form->{co_city} ne '')
+ ) {
print qq|
$form->{co_street}<br>
$form->{co_street1}<br>
$form->{co_zip} $form->{co_city}|;
- } else {
+ } else {
print qq|
<a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
| . $locale->text('Keine Firmenadresse hinterlegt!') . qq|</a>\n|;
}
- $form->{co_email}=$form->{email} unless $form->{co_email};
- $form->{co_tel}=$form->{tel} unless $form->{co_tel};
- $form->{co_fax}=$form->{fax} unless $form->{co_fax};
- $form->{co_url}=$form->{urlx} unless $form->{co_url};
-
-
+ $form->{co_email} = $form->{email} unless $form->{co_email};
+ $form->{co_tel} = $form->{tel} unless $form->{co_tel};
+ $form->{co_fax} = $form->{fax} unless $form->{co_fax};
+ $form->{co_url} = $form->{urlx} unless $form->{co_url};
+
print qq|
<br>
<br>
# accounting years if SQL-Ledger Version < 2.4.1
# $year = $form->{year} * 1;
- @years = sort { $b <=> $a } (2003 .. ($year+1));
+ @years = sort { $b <=> $a } (2003 .. ($year + 1));
$form->{all_years} = \@years;
}
map { $form->{selectaccountingyear} .= qq|<option>$_\n| }
<legend>
<b>| . $locale->text('Hinweise') . qq|</b>
</legend>
- <h2 class="confirm">| . $locale->text('Missing Preferences: Outputroutine disabled') . qq|</h2>
+ <h2 class="confirm">|
+ . $locale->text('Missing Preferences: Outputroutine disabled')
+ . qq|</h2>
<h3>| . $locale->text('Help:') . qq|</h3>
<ul>
<li>| . $locale->text('Hint-Missing-Preferences') . qq|</li>
sub help {
$lxdebug->enter_sub();
+
# parse help documents under doc
my $tmp = $form->{templates};
$form->{templates} = 'doc';
sub show {
$lxdebug->enter_sub();
+
#&generate_ustva();
no strict 'refs';
$lxdebug->leave_sub();
sub ustva_vorauswahl {
$lxdebug->enter_sub();
+
#Aktuelles Datum zerlegen:
my $date = $form->datetonum($form->current_date(\%myconfig), \%myconfig);
Actual year from Database: $form->{year}\n
Actual day from Database: $form->{day}\n
Actual month from Database: $form->{month}\n|);
-
+
my $sel = '';
my $yymmdd = '';
'10' => 'October',
'11' => 'November',
'12' => 'December',
- '13' => 'Yearly',
- );
-
+ '13' => 'Yearly',);
+
my $yy = $form->{year} * 10000;
$yymmdd = "$form->{year}$form->{month}$form->{day}" * 1;
$yymmdd = 20060121;
$sel = '';
- my $dfv = '0';
-
+ my $dfv = '0';
+
# Offset für Dauerfristverlängerung
$dfv = '100' if ($form->{FA_dauerfrist} eq '1');
$selected = 'selected' if ($sel eq $key);
print qq|
<option value="$key" $selected>|
- . $locale->text("$liste{$key}")
- . qq|</option>
+ . $locale->text("$liste{$key}") . qq|</option>
|;
}
} elsif ($form->{FA_voranmeld} eq 'quarter') {
# Vorauswahl bei quartalsweisem Voranmeldungszeitraum
- my %liste = ( 'A' => $locale->text('1. Quarter'),
- 'B' => $locale->text('2. Quarter'),
- 'C' => $locale->text('3. Quarter'),
- 'D' => $locale->text('4. Quarter'),
- '13' => $locale->text('Yearly'),
- );
+ my %liste = ('A' => $locale->text('1. Quarter'),
+ 'B' => $locale->text('2. Quarter'),
+ 'C' => $locale->text('3. Quarter'),
+ 'D' => $locale->text('4. Quarter'),
+ '13' => $locale->text('Yearly'),);
my $yy = $form->{year} * 10000;
$yymmdd = "$form->{year}$form->{month}$form->{day}" * 1;
'10' => 'October',
'11' => 'November',
'12' => 'December',
- '13' => 'Yearly',
- );
+ '13' => 'Yearly',);
my $key = '';
foreach $key (sort keys %listea) {
print qq|
- <option value="$key">| . $locale->text("$listea{$key}").
- qq|</option>\n|;
+ <option value="$key">|
+ . $locale->text("$listea{$key}")
+ . qq|</option>\n|;
}
foreach $key (sort keys %listeb) {
print qq|
- <option value="$key">| . $locale->text("$listeb{$key}").
- qq|</option>\n|;
+ <option value="$key">|
+ . $locale->text("$listeb{$key}")
+ . qq|</option>\n|;
}
print qq|</select>|;
}
$type
$media
<select name=format title = "|
- . $locale->text('Ausgabeformat auswählen...')
- . qq|">$format</select>
+ . $locale->text('Ausgabeformat auswählen...') . qq|">$format</select>
|;
$lxdebug->leave_sub();
}
#forgotten the year --> thisyear
if ($form->{year} !~ m/^\d\d\d\d$/) {
- $form->{year} = substr($form->datetonum($form->current_date(\%myconfig), \%myconfig),0,4);
- $lxdebug->message(LXDebug::DEBUG1, qq|Actual year from Database: $form->{year}\n|);
+ $form->{year} = substr(
+ $form->datetonum(
+ $form->current_date(\%myconfig), \%myconfig
+ ),
+ 0, 4);
+ $lxdebug->message(LXDebug::DEBUG1,
+ qq|Actual year from Database: $form->{year}\n|);
}
#yearly report
# using dates in ISO-8601 format: yyyymmmdd for Postgres...
USTVA->ustva(\%myconfig, \%$form);
-
+
# reformat Dates to dateformat
- $form->{fromdate}= $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0);
-
+ $form->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0);
+
$form->{todate} = $form->current_date($myconfig) unless $form->{todate};
- $form->{todate}= $locale->date(\%myconfig, $form->{todate}, 0, 0, 0);
+ $form->{todate} = $locale->date(\%myconfig, $form->{todate}, 0, 0, 0);
$form->{period} =
$locale->date(\%myconfig, $form->current_date(\%myconfig), 1, 0, 0);
-
# if there are any dates construct a where
if ($form->{fromdate} || $form->{todate}) {
$form->{endbold} = "}";
$form->{br} = '\\\\';
-
my @numbers = qw(511 861 36 80 971 931 98 96 53 74
- 85 65 66 61 62 Z67 63 64 59 69 39 83
- Z43 Z45 Z53 Z62 Z65);
-
+ 85 65 66 61 62 Z67 63 64 59 69 39 83
+ Z43 Z45 Z53 Z62 Z65);
+
my $number = '';
+
# Zahlenformatierung für Latex USTVA Formulare
- if ($myconfig{numberformat} eq '1.000,00' or
- $myconfig{numberformat} eq '1000,00') {
+ if ( $myconfig{numberformat} eq '1.000,00'
+ or $myconfig{numberformat} eq '1000,00') {
foreach $number (@numbers) {
$form->{$number} =~ s/,/~~/g;
}
- }
- if ($myconfig{numberformat} eq '1000.00' or
- $myconfig{numberformat} eq '1,000.00') {
+ }
+ if ( $myconfig{numberformat} eq '1000.00'
+ or $myconfig{numberformat} eq '1,000.00') {
foreach $number (@numbers) {
$form->{$number} =~ s/\./~~/g;
}
}
- # Formatierungen für HTML Ausgabe
- } elsif ($form->{format} eq 'html') {
+
+ # Formatierungen für HTML Ausgabe
+ } elsif ($form->{format} eq 'html') {
$form->{padding} = " ";
$form->{bold} = "<b>";
$form->{endbold} = "</b>";
}
if ($form->{format} eq 'elster') {
- if ($form->{duetyp} eq '13'){
+ if ($form->{duetyp} eq '13') {
$form->header;
- USTVA::info($locale->text('Impossible to create yearly Tax Report via Winston.<br \> Not yet implemented!'));
+ USTVA::info(
+ $locale->text(
+ 'Impossible to create yearly Tax Report via Winston.<br \> Not yet implemented!'
+ ));
} else {
&create_winston();
}
$form->{IN} = "$form->{type}";
$form->{IN} = "$form->{help}" if ($form->{type} eq 'help');
- $form->{IN} = 'USTE' if ($form->{duetyp} eq '13' &&
- $form->{format} ne 'html');
-
- if ($form->{IN} eq 'USTE'){
+ $form->{IN} = 'USTE'
+ if ( $form->{duetyp} eq '13'
+ && $form->{format} ne 'html');
+
+ if ($form->{IN} eq 'USTE') {
$form->header;
- USTVA::info($locale->text('Impossible to create yearly Tax Report as PDF or PS.<br \> Not yet implemented!'));
+ USTVA::info(
+ $locale->text(
+ 'Impossible to create yearly Tax Report as PDF or PS.<br \> Not yet implemented!'
+ ));
}
-
+
$form->{IN} .= "-$form->{year}"
if ( $form->{format} eq 'pdf'
or $form->{format} eq 'postscript');
sub edit {
$lxdebug->enter_sub();
+
# edit all taxauthority prefs
$form->header;
<table width=100%>
<tr>
<th class="listtop">|
- . $locale->text('Finanzamt - Einstellungen')
- . qq|</th>
+ . $locale->text('Finanzamt - Einstellungen') . qq|</th>
</tr>
<tr>
<td>
<br>
<fieldset>
<legend><b>|
- . $locale->text('Angaben zum Finanzamt')
- . qq|</b></legend>
+ . $locale->text('Angaben zum Finanzamt') . qq|</b></legend>
|;
#print qq|$form->{terminal}|;
print qq|
<input name="FA_dauerfrist" id=FA_dauerfrist class=checkbox type=checkbox value="1" $checked>
<label for="">|
- . $locale->text('Dauerfristverlängerung')
- . qq|</label>
+ . $locale->text('Dauerfristverlängerung') . qq|</label>
</fieldset>
<br>
<br>
<hr>
<!--<input type=submit class=submit name=action value="|
- . $locale->text('debug')
- . qq|">-->
+ . $locale->text('debug') . qq|">-->
|;
print qq|
<input type="button" name="Verweis" value="|
if ($form->{saved} eq $locale->text('saved'));
# Auf Übergabefehler checken
- USTVA::info(
- $locale->text('Missing Tax Authoritys Preferences') . "\n" .
- $locale->text('USTVA-Hint: Tax Authoritys'))
+ USTVA::info( $locale->text('Missing Tax Authoritys Preferences') . "\n"
+ . $locale->text('USTVA-Hint: Tax Authoritys'))
if ( $form->{elsterFFFF_new} eq 'Auswahl'
|| $form->{elsterland_new} eq 'Auswahl');
- USTVA::info(
- $locale->text('Missing Method!') . "\n" .
- $locale->text('USTVA-Hint: Method'))
+ USTVA::info( $locale->text('Missing Method!') . "\n"
+ . $locale->text('USTVA-Hint: Method'))
if ($form->{method} eq '');
# Klären, ob Variablen bereits befüllt sind UND ob veräderungen auf
# der vorherigen Maske stattfanden: $change = 1(in der edit sub,
# mittels get_config)
- my $change =
- $form->{elsterland} eq $form->{elsterland_new}
+ my $change = $form->{elsterland} eq $form->{elsterland_new}
&& $form->{elsterFFFF} eq $form->{elsterFFFF_new} ? '0' : '1';
$change = '0' if ($form->{saved} eq $locale->text('saved'));
my $elster_init = &elster_hash();
<table width="100%">
<tr>
<th colspan="2" class="listtop">|
- . $locale->text('Finanzamt - Einstellungen')
- . qq|</th>
+ . $locale->text('Finanzamt - Einstellungen') . qq|</th>
</tr>
<tr>
<td colspan=2>
<fieldset>
<legend>
<font size="+1">|
- . $locale->text('Finanzamt')
- . qq| $form->{FA_Name}</font>
+ . $locale->text('Finanzamt') . qq| $form->{FA_Name}</font>
</legend>
|;
sub continue {
$lxdebug->enter_sub();
+
# allow Symbolic references just here:
no strict 'refs';
&{ $form->{nextsub} };
$lxdebug->leave_sub();
}
-sub back {
+sub back {
$lxdebug->enter_sub();
- &{ $form->{lastsub} };
+ &{ $form->{lastsub} };
$lxdebug->leave_sub();
}