Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8c7e4493

Von Moritz Bunkus vor fast 17 Jahren hinzugefügt

  • ID 8c7e44938a661e035f62840e1e177353240ace5d
  • Vorgänger 3ced230b
  • Nachfolger ce45d060

Umstellung der Benutzerverwaltung von Dateien im Verzeichnis "users" auf die Verwendung einer Authentifizierungsdatenbank.
Es ist erforderlich, die Dateien doc/UPGRADE und doc/INSTALL/index.html zu lesen und die angesprochenen Punkte auszuführen, um nach einem Upgrade weiter arbeiten zu können.

Unterschiede anzeigen:

bin/mozilla/rp.pl
91 91
# $locale->text('Non-taxable Sales')
92 92
# $locale->text('Non-taxable Purchases')
93 93

  
94
my $rp_access_map = {
95
  'projects'         => 'report',
96
  'ar_aging'         => 'general_ledger',
97
  'ap_aging'         => 'general_ledger',
98
  'receipts'         => 'cash',
99
  'payments'         => 'cash',
100
  'trial_balance'    => 'report',
101
  'income_statement' => 'report',
102
  'bwa'              => 'report',
103
  'balance_sheet'    => 'report',
104
};
105

  
106
sub check_rp_access {
107
  my $right   = $rp_access_map->{$form->{report}};
108
  $right    ||= 'DOES_NOT_EXIST';
109

  
110
  $auth->assert($right);
111
}
112

  
94 113
sub report {
95 114
  $lxdebug->enter_sub();
96 115

  
116
  check_rp_access();
117

  
97 118
  %title = ('balance_sheet'        => 'Balance Sheet',
98 119
            'income_statement'     => 'Income Statement',
99 120
            'trial_balance'        => 'Trial Balance',
......
872 893
</table>
873 894

  
874 895
<br>
875
<input type=hidden name=login value=$form->{login}>
876
<input type=hidden name=password value=$form->{password}>
877

  
878 896
<input type=submit class=submit name=action value="|
879 897
    . $locale->text('Continue') . qq|">
880 898

  
......
891 909

  
892 910
sub get_project {
893 911
  $lxdebug->enter_sub();
912

  
913
  $auth->assert('report');
914

  
894 915
  my $nextsub = shift;
895 916

  
896 917
  $form->{project_id} = $form->{project_id_1};
......
914 935
sub generate_income_statement {
915 936
  $lxdebug->enter_sub();
916 937

  
938
  $auth->assert('report');
939

  
917 940
  $form->{padding} = "&nbsp;&nbsp;";
918 941
  $form->{bold}    = "<b>";
919 942
  $form->{endbold} = "</b>";
......
1081 1104
sub generate_balance_sheet {
1082 1105
  $lxdebug->enter_sub();
1083 1106

  
1107
  $auth->assert('report');
1108

  
1084 1109
  $form->{padding} = "&nbsp;&nbsp;";
1085 1110
  $form->{bold}    = "<b>";
1086 1111
  $form->{endbold} = "</b>";
......
1106 1131
  $form->{IN} = "balance_sheet.html";
1107 1132

  
1108 1133
  # setup company variables for the form
1109
  map { $form->{$_} = $myconfig{$_};
1110
        $form->{$_} =~ s/\\n/\n/g; }
1111
    (qw(company address businessnumber nativecurr));
1134
  map { $form->{$_} = $myconfig{$_}; } (qw(company address businessnumber nativecurr));
1112 1135

  
1113 1136
  $form->{templates} = $myconfig{templates};
1114 1137

  
......
1120 1143
sub generate_projects {
1121 1144
  $lxdebug->enter_sub();
1122 1145

  
1146
  $auth->assert('report');
1147

  
1123 1148
  &get_project(generate_projects);
1124 1149
  $form->{projectnumber} = $form->{projectnumber_1};
1125 1150

  
......
1141 1166
sub generate_trial_balance {
1142 1167
  $lxdebug->enter_sub();
1143 1168

  
1169
  $auth->assert('report');
1170

  
1144 1171
  # get for each account initial balance, debits and credits
1145 1172
  RP->trial_balance(\%myconfig, \%$form);
1146 1173

  
......
1290 1317
sub generate_ar_aging {
1291 1318
  $lxdebug->enter_sub();
1292 1319

  
1320
  $auth->assert('general_ledger');
1321

  
1293 1322
  # split customer
1294 1323
  ($form->{customer}) = split(/--/, $form->{customer});
1295 1324

  
......
1307 1336
sub generate_ap_aging {
1308 1337
  $lxdebug->enter_sub();
1309 1338

  
1339
  $auth->assert('general_ledger');
1340

  
1310 1341
  # split vendor
1311 1342
  ($form->{vendor}) = split(/--/, $form->{vendor});
1312 1343

  
......
1341 1372
sub aging {
1342 1373
  $lxdebug->enter_sub();
1343 1374

  
1375
  $auth->assert('general_ledger');
1376

  
1344 1377
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
1345 1378

  
1346 1379
  my @columns = qw(statement ct invnumber transdate duedate c0 c30 c60 c90);
......
1470 1503
sub e_mail {
1471 1504
  $lxdebug->enter_sub();
1472 1505

  
1506
  $auth->assert('general_ledger');
1507

  
1473 1508
  # get name and email addresses
1474 1509
  for $i (1 .. $form->{rowcount}) {
1475 1510
    if ($form->{"statement_$i"}) {
......
1545 1580

  
1546 1581
  # save all other variables
1547 1582
  foreach $key (keys %$form) {
1583
    next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
1548 1584
    $form->{$key} =~ s/\"/&quot;/g;
1549 1585
    print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
1550 1586
  }
......
1574 1610
sub send_email {
1575 1611
  $lxdebug->enter_sub();
1576 1612

  
1613
  $auth->assert('general_ledger');
1614

  
1577 1615
  $form->{subject} = $locale->text('Statement') . qq| - $form->{todate}|
1578 1616
    unless $form->{subject};
1579 1617

  
......
1592 1630
sub print {
1593 1631
  $lxdebug->enter_sub();
1594 1632

  
1633
  $auth->assert('general_ledger');
1634

  
1595 1635
  if ($form->{media} eq 'printer') {
1596 1636
    $form->error($locale->text('Select postscript or PDF!'))
1597 1637
      if ($form->{format} !~ /(postscript|pdf)/);
......
1626 1666
sub print_form {
1627 1667
  $lxdebug->enter_sub();
1628 1668

  
1669
  $auth->assert('general_ledger');
1670

  
1629 1671
  my %replacements =
1630 1672
    (
1631 1673
     "?" => "ae", "?" => "oe", "?" => "ue",
......
1738 1780

  
1739 1781
sub statement_details {
1740 1782
  $lxdebug->enter_sub();
1783

  
1784
  $auth->assert('general_ledger');
1785

  
1741 1786
  my ($ref) = @_;
1742 1787

  
1743 1788
  push @{ $form->{invnumber} }, $ref->{invnumber};
......
1761 1806
sub generate_tax_report {
1762 1807
  $lxdebug->enter_sub();
1763 1808

  
1809
  $auth->assert('report');
1810

  
1764 1811
  RP->tax_report(\%myconfig, \%$form);
1765 1812

  
1766 1813
  $descvar     = "$form->{accno}_description";
......
1771 1818

  
1772 1819
  # construct href
1773 1820
  $href =
1774
    "$form->{script}?&action=generate_tax_report&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
1821
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
1775 1822

  
1776 1823
  # construct callback
1777 1824
  $description = $form->escape($form->{$descvar},   1);
1778 1825
  $department  = $form->escape($form->{department}, 1);
1779 1826
  $callback    =
1780
    "$form->{script}?&action=generate_tax_report&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
1827
    "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}";
1781 1828

  
1782 1829
  $title = $form->escape($form->{title});
1783 1830
  $href .= "&title=$title";
......
1916 1963

  
1917 1964
    $column_data{id}        = qq|<td>$ref->{id}</td>|;
1918 1965
    $column_data{invnumber} =
1919
      qq|<td><a href=$module?action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}</a></td>|;
1966
      qq|<td><a href=$module?action=edit&id=$ref->{id}&callback=$callback>$ref->{invnumber}</a></td>|;
1920 1967
    $column_data{transdate} = qq|<td>$ref->{transdate}</td>|;
1921 1968
    $column_data{name}      = qq|<td>$ref->{name}&nbsp;</td>|;
1922 1969

  
......
2013 2060
sub list_payments {
2014 2061
  $lxdebug->enter_sub();
2015 2062

  
2063
  $auth->assert('cash');
2064

  
2016 2065
  if ($form->{account}) {
2017 2066
    ($form->{paymentaccounts}) = split /--/, $form->{account};
2018 2067
  }
......
2205 2254

  
2206 2255
sub generate_bwa {
2207 2256
  $lxdebug->enter_sub();
2257

  
2258
  $auth->assert('report');
2259

  
2208 2260
  $form->{padding} = "&nbsp;&nbsp;";
2209 2261
  $form->{bold}    = "<b>";
2210 2262
  $form->{endbold} = "</b>";

Auch abrufbar als: Unified diff