Revision 46b5ee69
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
48 | 48 |
use SL::Webdav; |
49 | 49 |
use SL::Locale::String qw(t8); |
50 | 50 |
|
51 |
require "bin/mozilla/arap.pl"; |
|
52 | 51 |
require "bin/mozilla/common.pl"; |
53 | 52 |
require "bin/mozilla/reportgenerator.pl"; |
54 | 53 |
|
bin/mozilla/arap.pl | ||
---|---|---|
1 |
#===================================================================== |
|
2 |
# LX-Office ERP |
|
3 |
# Copyright (C) 2004 |
|
4 |
# Based on SQL-Ledger Version 2.1.9 |
|
5 |
# Web http://www.lx-office.org |
|
6 |
# |
|
7 |
#===================================================================== |
|
8 |
# SQL-Ledger Accounting |
|
9 |
# Copyright (c) 2002 |
|
10 |
# |
|
11 |
# Author: Dieter Simader |
|
12 |
# Email: dsimader@sql-ledger.org |
|
13 |
# Web: http://www.sql-ledger.org |
|
14 |
# |
|
15 |
# |
|
16 |
# This program is free software; you can redistribute it and/or modify |
|
17 |
# it under the terms of the GNU General Public License as published by |
|
18 |
# the Free Software Foundation; either version 2 of the License, or |
|
19 |
# (at your option) any later version. |
|
20 |
# |
|
21 |
# This program is distributed in the hope that it will be useful, |
|
22 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
23 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
24 |
# GNU General Public License for more details. |
|
25 |
# You should have received a copy of the GNU General Public License |
|
26 |
# along with this program; if not, write to the Free Software |
|
27 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
28 |
# MA 02110-1335, USA. |
|
29 |
#====================================================================== |
|
30 |
# |
|
31 |
# common routines for gl, ar, ap, is, ir, oe |
|
32 |
# |
|
33 |
|
|
34 |
use strict; |
|
35 |
|
|
36 |
# any custom scripts for this one |
|
37 |
if (-f "bin/mozilla/custom_arap.pl") { |
|
38 |
eval { require "bin/mozilla/custom_arap.pl"; }; |
|
39 |
} |
|
40 |
if (-f "bin/mozilla/$::myconfig{login}_arap.pl") { |
|
41 |
eval { require "bin/mozilla/$::myconfig{login}_arap.pl"; }; |
|
42 |
} |
|
43 |
|
|
44 |
1; |
|
45 |
|
|
46 |
require "bin/mozilla/common.pl"; |
|
47 |
|
|
48 |
# end of main |
|
49 |
|
|
50 |
sub select_project { |
|
51 |
$::lxdebug->enter_sub; |
|
52 |
|
|
53 |
$::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
54 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); |
|
55 |
|
|
56 |
my ($is_global, $nextsub) = @_; |
|
57 |
my $project_list = delete $::form->{project_list}; |
|
58 |
|
|
59 |
map { delete $::form->{$_} } qw(action header update); |
|
60 |
|
|
61 |
my @hiddens; |
|
62 |
for my $key (keys %$::form) { |
|
63 |
next if $key eq 'login' || $key eq 'password' || '' ne ref $::form->{$key}; |
|
64 |
push @hiddens, { key => $key, value => $::form->{$key} }; |
|
65 |
} |
|
66 |
push @hiddens, { key => 'is_global', value => $is_global }, |
|
67 |
{ key => 'project_selected_nextsub', value => $nextsub }; |
|
68 |
|
|
69 |
$::form->header; |
|
70 |
print $::form->parse_html_template('arap/select_project', { hiddens => \@hiddens, project_list => $project_list }); |
|
71 |
|
|
72 |
$::lxdebug->leave_sub; |
|
73 |
} |
|
74 |
|
|
75 |
sub project_selected { |
|
76 |
$main::lxdebug->enter_sub(); |
|
77 |
|
|
78 |
my $form = $main::form; |
|
79 |
|
|
80 |
$main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . |
|
81 |
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); |
|
82 |
|
|
83 |
# replace the variable with the one checked |
|
84 |
|
|
85 |
# index for new item |
|
86 |
my $i = $form->{ndx}; |
|
87 |
|
|
88 |
my $prefix = $form->{"is_global"} ? "global" : ""; |
|
89 |
my $suffix = $form->{"is_global"} ? "" : "_$form->{rownumber}"; |
|
90 |
|
|
91 |
$form->{"${prefix}projectnumber${suffix}"} = |
|
92 |
$form->{"new_projectnumber_$i"}; |
|
93 |
$form->{"old${prefix}projectnumber${suffix}"} = |
|
94 |
$form->{"new_projectnumber_$i"}; |
|
95 |
$form->{"${prefix}project_id${suffix}"} = $form->{"new_id_$i"}; |
|
96 |
|
|
97 |
# delete all the new_ variables |
|
98 |
for $i (1 .. $form->{lastndx}) { |
|
99 |
map { delete $form->{"new_${_}_$i"} } qw(id projectnumber description); |
|
100 |
} |
|
101 |
|
|
102 |
my $nextsub = $form->{project_selected_nextsub} || 'update'; |
|
103 |
|
|
104 |
map { delete $form->{$_} } qw(ndx lastndx nextsub is_global project_selected_nextsub); |
|
105 |
|
|
106 |
call_sub($nextsub); |
|
107 |
|
|
108 |
$main::lxdebug->leave_sub(); |
|
109 |
} |
|
110 |
|
|
111 |
sub continue { call_sub($main::form->{"nextsub"}); } |
|
112 |
|
|
113 |
1; |
|
114 |
|
|
115 |
__END__ |
|
116 |
|
|
117 |
=head1 NAME |
|
118 |
|
|
119 |
arap.pl - helper functions or customer/vendor retrieval |
|
120 |
|
|
121 |
=head1 SYNOPSIS |
|
122 |
|
|
123 |
check_name('vendor') |
|
124 |
|
|
125 |
=head1 DESCRIPTION |
|
126 |
|
|
127 |
Don't use anyting in this file without extreme care, and even then be prepared for massive headaches. |
|
128 |
|
|
129 |
It's a collection of helper routines that wrap the customer/vendor dropdown/textfield duality into something even complexer. |
|
130 |
|
|
131 |
=cut |
bin/mozilla/common.pl | ||
---|---|---|
437 | 437 |
goto &SL::DB::Helper::Mappings::db; |
438 | 438 |
} |
439 | 439 |
|
440 |
sub continue { call_sub($::form->{nextsub}); } |
|
441 |
|
|
440 | 442 |
1; |
bin/mozilla/cp.pl | ||
---|---|---|
41 | 41 |
use strict; |
42 | 42 |
#use warnings; |
43 | 43 |
|
44 |
require "bin/mozilla/arap.pl"; |
|
45 | 44 |
require "bin/mozilla/common.pl"; |
46 | 45 |
|
47 | 46 |
our ($form, %myconfig, $lxdebug, $locale, $auth); |
bin/mozilla/do.pl | ||
---|---|---|
45 | 45 |
use SL::ReportGenerator; |
46 | 46 |
use SL::WH; |
47 | 47 |
use Sort::Naturally (); |
48 |
require "bin/mozilla/arap.pl"; |
|
49 | 48 |
require "bin/mozilla/common.pl"; |
50 | 49 |
require "bin/mozilla/io.pl"; |
51 | 50 |
require "bin/mozilla/reportgenerator.pl"; |
... | ... | |
1820 | 1819 |
|
1821 | 1820 |
do.pl - Script for all calls to delivery order |
1822 | 1821 |
|
1823 |
|
|
1824 | 1822 |
=head1 FUNCTIONS |
1825 | 1823 |
|
1826 | 1824 |
=over 2 |
bin/mozilla/ir.pl | ||
---|---|---|
43 | 43 |
use List::UtilsBy qw(sort_by); |
44 | 44 |
|
45 | 45 |
require "bin/mozilla/io.pl"; |
46 |
require "bin/mozilla/arap.pl"; |
|
47 | 46 |
require "bin/mozilla/common.pl"; |
48 | 47 |
|
49 | 48 |
use strict; |
bin/mozilla/is.pl | ||
---|---|---|
49 | 49 |
use SL::DB::Invoice; |
50 | 50 |
use SL::DB::PaymentTerm; |
51 | 51 |
|
52 |
require "bin/mozilla/common.pl"; |
|
52 | 53 |
require "bin/mozilla/io.pl"; |
53 |
require "bin/mozilla/arap.pl"; |
|
54 | 54 |
|
55 | 55 |
use strict; |
56 | 56 |
|
bin/mozilla/oe.pl | ||
---|---|---|
52 | 52 |
use SL::DB::TaxZone; |
53 | 53 |
use SL::DB::PaymentTerm; |
54 | 54 |
|
55 |
require "bin/mozilla/common.pl"; |
|
55 | 56 |
require "bin/mozilla/io.pl"; |
56 |
require "bin/mozilla/arap.pl"; |
|
57 | 57 |
require "bin/mozilla/reportgenerator.pl"; |
58 | 58 |
|
59 | 59 |
use strict; |
bin/mozilla/rp.pl | ||
---|---|---|
47 | 47 |
use Data::Dumper; |
48 | 48 |
use List::MoreUtils qw(any); |
49 | 49 |
|
50 |
require "bin/mozilla/arap.pl"; |
|
51 | 50 |
require "bin/mozilla/common.pl"; |
52 | 51 |
require "bin/mozilla/reportgenerator.pl"; |
53 | 52 |
|
bin/mozilla/vk.pl | ||
---|---|---|
42 | 42 |
use SL::ReportGenerator; |
43 | 43 |
use Data::Dumper; |
44 | 44 |
|
45 |
require "bin/mozilla/arap.pl"; |
|
46 | 45 |
require "bin/mozilla/common.pl"; |
47 | 46 |
require "bin/mozilla/reportgenerator.pl"; |
48 | 47 |
|
locale/de/all | ||
---|---|---|
2512 | 2512 |
'Select federal state...' => 'Bundesland auswählen...', |
2513 | 2513 |
'Select file to upload' => 'Datei zum Hochladen auswählen', |
2514 | 2514 |
'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge', |
2515 |
'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte', |
|
2516 | 2515 |
'Select postscript or PDF!' => 'Postscript oder PDF auswählen!', |
2517 | 2516 |
'Select tax office...' => 'Finanzamt auswählen...', |
2518 | 2517 |
'Select template to paste' => 'Einzufügende Vorlage auswählen', |
templates/webpages/arap/select_project.html | ||
---|---|---|
1 |
[%- USE HTML %] |
|
2 |
[%- USE T8 %] |
|
3 |
[%- USE L %] |
|
4 |
[%- USE LxERP %] |
|
5 |
|
|
6 |
<h1>[% 'Select from one of the projects below' | $T8 %]</h1> |
|
7 |
|
|
8 |
<form method=post action="[% script %]"> |
|
9 |
|
|
10 |
<table width=100%> |
|
11 |
<tr class=listheading> |
|
12 |
<th> </th> |
|
13 |
<th>[% 'Number' | $T8 %]</th> |
|
14 |
<th>[% 'Description' | $T8 %]</th> |
|
15 |
</tr> |
|
16 |
[%- FOREACH row IN project_list %] |
|
17 |
<tr class=listrow[% loop.count % 2 %]> |
|
18 |
<td>[% L.radio_button_tag('ndx', value=loop.count, checked=loop.first) %]</td> |
|
19 |
<td>[% row.projectnumber | html %]</td> |
|
20 |
<td>[% row.description | html %]</td> |
|
21 |
[% L.hidden_tag('new_id_' _ loop.count, row.id) %] |
|
22 |
[% L.hidden_tag('new_projectnumber_' _ loop.count, row.projectnumber) %] |
|
23 |
</tr> |
|
24 |
[%- END %] |
|
25 |
</table> |
|
26 |
|
|
27 |
<hr size=3 noshade> |
|
28 |
|
|
29 |
[% L.hidden_tag(row.key, row.value) FOREACH row = hiddens %] |
|
30 |
[% L.hidden_tag('lastndx', project_list.size) %] |
|
31 |
[% L.hidden_tag('nextsub', 'project_selected') %] |
|
32 |
[% L.hidden_tag('rownumber', rownumber) %] |
|
33 |
[% L.submit_tag('action', LxERP.t8('Continue')) %] |
|
34 |
|
|
35 |
</form> |
|
36 |
|
Auch abrufbar als: Unified diff
arap.pl entfernt
Sie enthielt nur noch drei Funktionen:
• select_project — wurde nirgends mehr verwendet
• project_selected — war nur eine Helferfunktion für select_project
• continue — diese wurde nach common.pl verschoben