1
|
#!/usr/bin/perl
|
2
|
|
3
|
use warnings;
|
4
|
use strict;
|
5
|
use 5.008;
|
6
|
|
7
|
use SL::Dispatcher;
|
8
|
use Data::Dumper;
|
9
|
use Devel::REPL 1.002001;
|
10
|
use File::Slurp;
|
11
|
use Getopt::Long;
|
12
|
use Pod::Usage;
|
13
|
use CGI qw( -no_xhtml);
|
14
|
use DateTime;
|
15
|
use SL::Auth;
|
16
|
use SL::Form;
|
17
|
use SL::Helper::DateTime;
|
18
|
use SL::InstanceConfiguration;
|
19
|
use SL::Locale;
|
20
|
use SL::LXDebug;
|
21
|
use Data::Dumper;
|
22
|
use List::Util qw(max);
|
23
|
use Time::HiRes;
|
24
|
|
25
|
use SL::LxOfficeConf;
|
26
|
SL::LxOfficeConf->read;
|
27
|
|
28
|
|
29
|
# FILL IN!
|
30
|
my $client = '1';
|
31
|
my $login = 'odadmin';
|
32
|
|
33
|
$::lxdebug = LXDebug->new();
|
34
|
$::locale = Locale->new($::lx_office_conf{system}->{language});
|
35
|
$::form = Form->new;
|
36
|
$::auth = SL::Auth->new;
|
37
|
die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client);
|
38
|
|
39
|
$::instance_conf = SL::InstanceConfiguration->new;
|
40
|
$::request = SL::Request->new(
|
41
|
cgi => CGI->new({}),
|
42
|
layout => SL::Layout::None->new,
|
43
|
);
|
44
|
|
45
|
die 'cannot reach auth db' unless $::auth->session_tables_present;
|
46
|
|
47
|
$::auth->restore_session;
|
48
|
|
49
|
require "bin/mozilla/common.pl";
|
50
|
|
51
|
die "cannot find user $login" unless %::myconfig = $::auth->read_user(login => $login);
|
52
|
|
53
|
die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode});
|
54
|
|
55
|
$::instance_conf->init;
|
56
|
|
57
|
|
58
|
|
59
|
# ACTUAL REQUEST GOES HERE
|
60
|
# exmaple:
|
61
|
|
62
|
my $formvars = <<EOF;
|
63
|
id = 643656
|
64
|
item = part
|
65
|
title = Ware bearbeiten
|
66
|
makemodel = 1
|
67
|
alternate = 0
|
68
|
onhand = 0
|
69
|
orphaned = 1
|
70
|
taxaccounts =
|
71
|
rowcount =
|
72
|
eur =
|
73
|
original_partnumber = 360082
|
74
|
currow =
|
75
|
cursor_fokus =
|
76
|
lastmtime = 14.06.2016 14:35:15.617518
|
77
|
ui_tab =
|
78
|
partnumber =
|
79
|
partstypes_id = 3
|
80
|
description = Danfoss Sicherheitsüberströmventil SAVA DN40 G2", Sollwertbereich 2-7 bar
|
81
|
notes =
|
82
|
ean =
|
83
|
customs_tariff_number =
|
84
|
buchungsgruppen_id = 936
|
85
|
IC_income =
|
86
|
IC_expense =
|
87
|
IC = 1140--Waren (Bestand)
|
88
|
payment_id =
|
89
|
formel =
|
90
|
image =
|
91
|
microfiche =
|
92
|
drawing =
|
93
|
intnotes =
|
94
|
priceupdate = 14.06.2016
|
95
|
listprice = 0,00
|
96
|
sellprice = 0,00
|
97
|
lastcost = 575,4
|
98
|
price_factor_id =
|
99
|
unit_changeable = 1
|
100
|
unit = Stck
|
101
|
weight = 0
|
102
|
dispotype = consumption
|
103
|
leadtime = 0
|
104
|
consume = 0
|
105
|
ordersize = 0
|
106
|
rop = 0
|
107
|
warehouse_id = 0
|
108
|
bin_id = 0
|
109
|
ve = 0
|
110
|
gv = 0
|
111
|
has_customer_vendor_picker = 1
|
112
|
cp_customer_id_1 =
|
113
|
cp_customer_name_1 =
|
114
|
cp_partnumber_1 =
|
115
|
cp_partdescription_1 =
|
116
|
cp_old_price_1 = 0,00
|
117
|
cp_price_1 = 0,00
|
118
|
cp_lastupdate_1 =
|
119
|
cp_sortorder_1 =
|
120
|
cprices_rows = 1
|
121
|
has_customer_vendor_picker = 1
|
122
|
make_1 = 28559
|
123
|
makename_1 = Danfoss GmbH
|
124
|
model_1 = 003H6973
|
125
|
model_description_1 = Danfoss Sicherheitsüberströmventil SAVA DN40 G2", Sollwertbereich 2-7 bar
|
126
|
old_lastcost_1 = 510,60000
|
127
|
lastcost_1 = 575,4
|
128
|
lastupdate_1 = 14.06.2016
|
129
|
sortorder_1 =
|
130
|
priceupdate_1 = Y
|
131
|
make_2 =
|
132
|
makename_2 =
|
133
|
model_2 =
|
134
|
model_description_2 =
|
135
|
old_lastcost_2 = 0,00000
|
136
|
lastcost_2 = 0,00000
|
137
|
lastupdate_2 =
|
138
|
sortorder_2 =
|
139
|
priceupdate_2 = Y
|
140
|
makemodel_rows = 2
|
141
|
callback = ic.pl?action=generate_report&l_linetotal=Y&searchitems=article&l_part=Y&partstypes_id=3&itemstatus=active&l_pricegroups=Y&partstypes_id=3&description=danfoss%25sicherhe&l_partnumber=Y&l_ptype=Y&l_description=1&l_onhand=Y&l_unit=Y&l_sellprice=Y&l_linetotalsellprice=Y&l_lastcost=Y&l_linetotallastcost=Y&sort=description&revers=0
|
142
|
previousform =
|
143
|
taxaccount2 =
|
144
|
vc =
|
145
|
cvar_Vorlauf1_valid = on
|
146
|
cvar_Vorlauf1 = 50
|
147
|
cvar_Vorlauf2_valid = on
|
148
|
cvar_Vorlauf2 = 70
|
149
|
cvar_Ruecklauf1_valid = on
|
150
|
cvar_Ruecklauf1 = 50
|
151
|
cvar_Ruecklauf2_valid = on
|
152
|
cvar_Ruecklauf2 = 47
|
153
|
cvar_Nennweite1_valid = on
|
154
|
cvar_Nennweite1 = 25
|
155
|
cvar_Nennweite2_valid = on
|
156
|
cvar_Nennweite2 = 40
|
157
|
cvar_GesWaerme1_valid = on
|
158
|
cvar_GesWaerme1 = 110,00
|
159
|
cvar_GesWaerme2_valid = on
|
160
|
cvar_GesWaerme2 = 110
|
161
|
cvar_MassLaenge_valid = on
|
162
|
cvar_MassLaenge = 2.200
|
163
|
cvar_MassHoehe_valid = on
|
164
|
cvar_MassHoehe = 1.600
|
165
|
cvar_MassTiefe_valid = on
|
166
|
cvar_MassTiefe = 600
|
167
|
cvar_bom_valid = on
|
168
|
cvar_bom = 0-Unbestimmt
|
169
|
cvar_typ_valid = on
|
170
|
cvar_typ =
|
171
|
cvar_auslegung_p_valid = on
|
172
|
cvar_auslegung_p =
|
173
|
cvar_auslegung_s_valid = on
|
174
|
cvar_auslegung_s =
|
175
|
cvar_auslegung_b_valid = on
|
176
|
cvar_auslegung_b =
|
177
|
cvar_max_Temp_valid = on
|
178
|
cvar_max_Temp = 0
|
179
|
cvar_pruefdruck_valid = on
|
180
|
cvar_pruefdruck =
|
181
|
cvar_pruefmedium_valid = on
|
182
|
cvar_pruefmedium =
|
183
|
cvar_regler_valid = on
|
184
|
cvar_regler =
|
185
|
price_rows = 0
|
186
|
cursor_fokus =
|
187
|
action = als neu speichern
|
188
|
EOF
|
189
|
|
190
|
|
191
|
my @lines = split("\n",$formvars);
|
192
|
foreach my $line ( @lines ) {
|
193
|
my ( $name,$value ) = split("=",$line,2);
|
194
|
$name =~ s/^\s+|\s+$//g;
|
195
|
$value =~ s/^\s+|\s+$//g;
|
196
|
$::form->{"$name"} = $value;
|
197
|
}
|
198
|
|
199
|
#my $dbh = SL::DB::Object->new->db->dbh;
|
200
|
#warn "MH2 dbh=".$dbh."\n";
|
201
|
#$::form->set_standard_dbh($dbh);
|
202
|
require "bin/mozilla/ic.pl";
|
203
|
save_as_new();
|
204
|
|