Revision e7214232
Von Moritz Bunkus vor etwa 18 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
1191 | 1191 |
$main::lxdebug->leave_sub(); |
1192 | 1192 |
} |
1193 | 1193 |
|
1194 |
sub adr { |
|
1195 |
$main::lxdebug->enter_sub(); |
|
1196 |
|
|
1197 |
my ($self, $myconfig, $form) = @_; |
|
1198 |
|
|
1199 |
# connect to database |
|
1200 |
my $dbh = $form->dbconnect($myconfig); |
|
1201 |
|
|
1202 |
my $query = qq|SELECT id, adr_description, adr_code |
|
1203 |
FROM adr |
|
1204 |
ORDER BY adr_code|; |
|
1205 |
|
|
1206 |
$sth = $dbh->prepare($query); |
|
1207 |
$sth->execute || $form->dberror($query); |
|
1208 |
|
|
1209 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
1210 |
push @{ $form->{ALL} }, $ref; |
|
1211 |
} |
|
1212 |
|
|
1213 |
$sth->finish; |
|
1214 |
$dbh->disconnect; |
|
1215 |
|
|
1216 |
$main::lxdebug->leave_sub(); |
|
1217 |
} |
|
1218 |
|
|
1219 |
sub get_adr { |
|
1220 |
$main::lxdebug->enter_sub(); |
|
1221 |
|
|
1222 |
my ($self, $myconfig, $form) = @_; |
|
1223 |
|
|
1224 |
# connect to database |
|
1225 |
my $dbh = $form->dbconnect($myconfig); |
|
1226 |
|
|
1227 |
my $query = |
|
1228 |
qq|SELECT a.adr_description, a.adr_code |
|
1229 |
FROM adr a |
|
1230 |
WHERE a.id = $form->{id}|; |
|
1231 |
my $sth = $dbh->prepare($query); |
|
1232 |
$sth->execute || $form->dberror($query); |
|
1233 |
|
|
1234 |
my $ref = $sth->fetchrow_hashref(NAME_lc); |
|
1235 |
|
|
1236 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
|
1237 |
|
|
1238 |
$sth->finish; |
|
1239 |
|
|
1240 |
$dbh->disconnect; |
|
1241 |
|
|
1242 |
$main::lxdebug->leave_sub(); |
|
1243 |
} |
|
1244 |
|
|
1245 |
sub save_adr { |
|
1246 |
$main::lxdebug->enter_sub(); |
|
1247 |
|
|
1248 |
my ($self, $myconfig, $form) = @_; |
|
1249 |
|
|
1250 |
# connect to database |
|
1251 |
my $dbh = $form->dbconnect($myconfig); |
|
1252 |
|
|
1253 |
$form->{adr_description} =~ s/\'/\'\'/g; |
|
1254 |
$form->{adr_code} =~ s/\'/\'\'/g; |
|
1255 |
|
|
1256 |
|
|
1257 |
# id is the old record |
|
1258 |
if ($form->{id}) { |
|
1259 |
$query = qq|UPDATE adr SET |
|
1260 |
adr_description = '$form->{adr_description}', |
|
1261 |
adr_code = '$form->{adr_code}' |
|
1262 |
WHERE id = $form->{id}|; |
|
1263 |
} else { |
|
1264 |
$query = qq|INSERT INTO adr |
|
1265 |
(adr_description, adr_code) |
|
1266 |
VALUES ('$form->{adr_description}', '$form->{adr_code}')|; |
|
1267 |
} |
|
1268 |
$dbh->do($query) || $form->dberror($query); |
|
1269 |
|
|
1270 |
$dbh->disconnect; |
|
1271 |
|
|
1272 |
$main::lxdebug->leave_sub(); |
|
1273 |
} |
|
1274 |
|
|
1275 |
sub delete_adr { |
|
1276 |
$main::lxdebug->enter_sub(); |
|
1277 |
|
|
1278 |
my ($self, $myconfig, $form) = @_; |
|
1279 |
|
|
1280 |
# connect to database |
|
1281 |
my $dbh = $form->dbconnect($myconfig); |
|
1282 |
|
|
1283 |
$query = qq|DELETE FROM adr |
|
1284 |
WHERE id = $form->{id}|; |
|
1285 |
$dbh->do($query) || $form->dberror($query); |
|
1286 |
|
|
1287 |
$dbh->disconnect; |
|
1288 |
|
|
1289 |
$main::lxdebug->leave_sub(); |
|
1290 |
} |
|
1291 |
|
|
1292 | 1194 |
sub payment { |
1293 | 1195 |
$main::lxdebug->enter_sub(); |
1294 | 1196 |
|
SL/CT.pm | ||
---|---|---|
875 | 875 |
if ($form->{to}) { |
876 | 876 |
$where .= "AND $tabelle.transdate <= '$form->{to}' "; |
877 | 877 |
} |
878 |
my $query = qq|select shiptoname, adr_code, $tabelle.transdate, $tabelle.invnumber, $tabelle.ordnumber, invoice.description, qty, invoice.unit FROM $tabelle LEFT JOIN shipto ON |;
|
|
878 |
my $query = qq|select shiptoname, $tabelle.transdate, $tabelle.invnumber, $tabelle.ordnumber, invoice.description, qty, invoice.unit FROM $tabelle LEFT JOIN shipto ON |; |
|
879 | 879 |
$query .= ($tabelle eq "ar") ? qq|($tabelle.shipto_id=shipto.shipto_id) |:qq|($tabelle.id=shipto.trans_id) |; |
880 |
$query .=qq|LEFT join invoice on ($tabelle.id=invoice.trans_id) LEFT join parts ON (parts.id=invoice.parts_id) LEFT join adr ON (parts.adr_id=adr.id) $where ORDER BY $tabelle.transdate DESC LIMIT 15|;
|
|
880 |
$query .=qq|LEFT join invoice on ($tabelle.id=invoice.trans_id) LEFT join parts ON (parts.id=invoice.parts_id) $where ORDER BY $tabelle.transdate DESC LIMIT 15|; |
|
881 | 881 |
my $sth = $dbh->prepare($query); |
882 | 882 |
$sth->execute || $form->dberror($query); |
883 | 883 |
|
... | ... | |
891 | 891 |
$main::lxdebug->leave_sub(); |
892 | 892 |
} |
893 | 893 |
|
894 |
sub adr { |
|
895 |
$main::lxdebug->enter_sub(); |
|
896 |
|
|
897 |
my ($self, $myconfig, $form) = @_; |
|
898 |
my $dbh = $form->dbconnect($myconfig); |
|
899 |
$where = " WHERE 1=1 "; |
|
900 |
if ($form->{from}) { |
|
901 |
$where .= "AND ar.transdate >= '$form->{from}' "; |
|
902 |
} |
|
903 |
if ($form->{to}) { |
|
904 |
$where .= "AND ar.transdate <= '$form->{to}' "; |
|
905 |
} |
|
906 |
if ($form->{year}) { |
|
907 |
$where = " WHERE ar.transdate >= '$form->{year}-01-01' AND ar.transdate <= '$form->{year}-12-31' "; |
|
908 |
} |
|
909 |
|
|
910 |
my $query = qq|select adr_code, adr_description, sum(base_qty), parts.unit from ar LEFT join invoice on (ar.id=invoice.trans_id) LEFT join parts ON (invoice.parts_id=parts.id) LEFT join adr ON (adr.id=parts.adr_id) $where GROUP BY adr_code,adr_description,parts.unit|; |
|
911 |
my $sth = $dbh->prepare($query); |
|
912 |
$sth->execute || $form->dberror($query); |
|
913 |
|
|
914 |
|
|
915 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
916 |
push @{ $form->{ADR} }, $ref; |
|
917 |
} |
|
918 |
$sth->finish; |
|
919 |
$dbh->disconnect; |
|
920 |
|
|
921 |
$main::lxdebug->leave_sub(); |
|
922 |
} |
|
923 |
|
|
924 | 894 |
1; |
925 | 895 |
|
SL/Form.pm | ||
---|---|---|
1563 | 1563 |
} |
1564 | 1564 |
$sth->finish; |
1565 | 1565 |
|
1566 |
# get adr |
|
1567 |
$query = qq|SELECT id, adr_description, adr_code |
|
1568 |
FROM adr|; |
|
1569 |
$sth = $dbh->prepare($query); |
|
1570 |
$sth->execute || $form->dberror($query); |
|
1571 |
|
|
1572 |
|
|
1573 |
$self->{ADR} = []; |
|
1574 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
1575 |
push @{ $self->{ADR} }, $ref; |
|
1576 |
} |
|
1577 |
$sth->finish; |
|
1578 | 1566 |
$dbh->disconnect; |
1579 | 1567 |
$main::lxdebug->leave_sub(); |
1580 | 1568 |
} |
SL/IC.pm | ||
---|---|---|
372 | 372 |
$form->{ge} *= 1; |
373 | 373 |
$form->{alu} *= 1; |
374 | 374 |
$form->{buchungsgruppen_id} *= 1; |
375 |
$form->{adr_id} *= 1; |
|
376 | 375 |
$form->{not_discountable} *= 1; |
377 | 376 |
$form->{payment_id} *= 1; |
378 | 377 |
|
... | ... | |
491 | 490 |
rop = $form->{rop}, |
492 | 491 |
bin = '$form->{bin}', |
493 | 492 |
buchungsgruppen_id = '$form->{buchungsgruppen_id}', |
494 |
adr_id = '$form->{adr_id}', |
|
495 | 493 |
payment_id = '$form->{payment_id}', |
496 | 494 |
inventory_accno_id = (SELECT c.id FROM chart c |
497 | 495 |
WHERE c.accno = '$form->{inventory_accno}'), |
... | ... | |
1511 | 1509 |
} |
1512 | 1510 |
$sth->finish; |
1513 | 1511 |
|
1514 |
# get adr |
|
1515 |
$query = qq|SELECT id, adr_description, adr_code |
|
1516 |
FROM adr|; |
|
1517 |
$sth = $dbh->prepare($query); |
|
1518 |
$sth->execute || $form->dberror($query); |
|
1519 |
|
|
1520 |
|
|
1521 |
$form->{ADR} = []; |
|
1522 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) { |
|
1523 |
push @{ $form->{ADR} }, $ref; |
|
1524 |
} |
|
1525 |
$sth->finish; |
|
1526 |
|
|
1527 | 1512 |
# get payment terms |
1528 | 1513 |
$query = qq|SELECT id, description |
1529 | 1514 |
FROM payment_terms |
SL/IS.pm | ||
---|---|---|
1902 | 1902 |
c2.accno AS income_accno, c2.new_chart_id AS income_new_chart, date($transdate) - c2.valid_from as income_valid, |
1903 | 1903 |
c3.accno AS expense_accno, c3.new_chart_id AS expense_new_chart, date($transdate) - c3.valid_from as expense_valid, |
1904 | 1904 |
p.unit, p.assembly, p.bin, p.onhand, p.notes AS partnotes, p.notes AS longdescription, p.not_discountable, |
1905 |
pg.partsgroup, p.formel, p.alu, p.payment_id AS part_payment_id, adr.adr_description
|
|
1905 |
pg.partsgroup, p.formel, p.alu, p.payment_id AS part_payment_id |
|
1906 | 1906 |
FROM parts p |
1907 | 1907 |
LEFT JOIN chart c1 ON ((select inventory_accno_id from buchungsgruppen where id=p.buchungsgruppen_id) = c1.id) |
1908 | 1908 |
LEFT JOIN chart c2 ON ((select income_accno_id_$form->{taxzone_id} from buchungsgruppen where id=p.buchungsgruppen_id) = c2.id) |
1909 | 1909 |
LEFT JOIN chart c3 ON ((select expense_accno_id_$form->{taxzone_id} from buchungsgruppen where id=p.buchungsgruppen_id) = c3.id) |
1910 | 1910 |
LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id) |
1911 |
LEFT JOIN adr adr ON (adr.id = p.adr_id) |
|
1912 | 1911 |
WHERE $where|; |
1913 | 1912 |
my $sth = $dbh->prepare($query); |
1914 | 1913 |
$sth->execute || $form->dberror($query); |
bin/mozilla/am.pl | ||
---|---|---|
2267 | 2267 |
} |
2268 | 2268 |
|
2269 | 2269 |
|
2270 |
sub add_adr { |
|
2271 |
$lxdebug->enter_sub(); |
|
2272 |
|
|
2273 |
$form->{title} = "Add"; |
|
2274 |
|
|
2275 |
$form->{callback} = |
|
2276 |
"$form->{script}?action=add_adr&path=$form->{path}&login=$form->{login}&password=$form->{password}" |
|
2277 |
unless $form->{callback}; |
|
2278 |
|
|
2279 |
&adr_header; |
|
2280 |
&form_footer; |
|
2281 |
|
|
2282 |
$lxdebug->leave_sub(); |
|
2283 |
} |
|
2284 |
|
|
2285 |
sub edit_adr { |
|
2286 |
$lxdebug->enter_sub(); |
|
2287 |
|
|
2288 |
$form->{title} = "Edit"; |
|
2289 |
|
|
2290 |
AM->get_adr(\%myconfig, \%$form); |
|
2291 |
|
|
2292 |
&adr_header; |
|
2293 |
|
|
2294 |
$form->{orphaned} = 1; |
|
2295 |
&form_footer; |
|
2296 |
|
|
2297 |
$lxdebug->leave_sub(); |
|
2298 |
} |
|
2299 |
|
|
2300 |
sub list_adr { |
|
2301 |
$lxdebug->enter_sub(); |
|
2302 |
|
|
2303 |
AM->adr(\%myconfig, \%$form); |
|
2304 |
|
|
2305 |
$form->{callback} = |
|
2306 |
"$form->{script}?action=list_adr&path=$form->{path}&login=$form->{login}&password=$form->{password}"; |
|
2307 |
|
|
2308 |
$callback = $form->escape($form->{callback}); |
|
2309 |
|
|
2310 |
$form->{title} = $locale->text('ADR'); |
|
2311 |
|
|
2312 |
@column_index = qw(adr_code adr_description); |
|
2313 |
|
|
2314 |
$column_header{adr_description} = |
|
2315 |
qq|<th class=listheading width=60%>| |
|
2316 |
. $locale->text('ADR Description') |
|
2317 |
. qq|</th>|; |
|
2318 |
$column_header{adr_code} = |
|
2319 |
qq|<th class=listheading width=10%>| |
|
2320 |
. $locale->text('ADR Code') |
|
2321 |
. qq|</th>|; |
|
2322 |
|
|
2323 |
$form->header; |
|
2324 |
|
|
2325 |
print qq| |
|
2326 |
<body> |
|
2327 |
|
|
2328 |
<table width=100%> |
|
2329 |
<tr> |
|
2330 |
<th class=listtop>$form->{title}</th> |
|
2331 |
</tr> |
|
2332 |
<tr height="5"></tr> |
|
2333 |
<tr> |
|
2334 |
<td> |
|
2335 |
<table width=100%> |
|
2336 |
<tr class=listheading> |
|
2337 |
|; |
|
2338 |
|
|
2339 |
map { print "$column_header{$_}\n" } @column_index; |
|
2340 |
|
|
2341 |
print qq| |
|
2342 |
</tr> |
|
2343 |
|; |
|
2344 |
|
|
2345 |
foreach $ref (@{ $form->{ALL} }) { |
|
2346 |
|
|
2347 |
$i++; |
|
2348 |
$i %= 2; |
|
2349 |
|
|
2350 |
print qq| |
|
2351 |
<tr valign=top class=listrow$i> |
|
2352 |
|; |
|
2353 |
|
|
2354 |
|
|
2355 |
$column_data{adr_code} = |
|
2356 |
qq|<td><a href=$form->{script}?action=edit_adr&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{adr_code}</td>|; |
|
2357 |
$column_data{adr_description} = qq|<td align=left>$ref->{adr_description}</td>|; |
|
2358 |
|
|
2359 |
|
|
2360 |
map { print "$column_data{$_}\n" } @column_index; |
|
2361 |
|
|
2362 |
print qq| |
|
2363 |
</tr> |
|
2364 |
|; |
|
2365 |
} |
|
2366 |
|
|
2367 |
print qq| |
|
2368 |
</table> |
|
2369 |
</td> |
|
2370 |
</tr> |
|
2371 |
<tr> |
|
2372 |
<td><hr size=3 noshade></td> |
|
2373 |
</tr> |
|
2374 |
</table> |
|
2375 |
|
|
2376 |
<br> |
|
2377 |
<form method=post action=$form->{script}> |
|
2378 |
|
|
2379 |
<input name=callback type=hidden value="$form->{callback}"> |
|
2380 |
|
|
2381 |
<input type=hidden name=type value=adr> |
|
2382 |
|
|
2383 |
<input type=hidden name=path value=$form->{path}> |
|
2384 |
<input type=hidden name=login value=$form->{login}> |
|
2385 |
<input type=hidden name=password value=$form->{password}> |
|
2386 |
|
|
2387 |
<input class=submit type=submit name=action value="| |
|
2388 |
. $locale->text('Add') . qq|">|; |
|
2389 |
|
|
2390 |
if ($form->{menubar}) { |
|
2391 |
require "$form->{path}/menu.pl"; |
|
2392 |
&menubar; |
|
2393 |
} |
|
2394 |
|
|
2395 |
print qq| |
|
2396 |
|
|
2397 |
</form> |
|
2398 |
|
|
2399 |
</body> |
|
2400 |
</html> |
|
2401 |
|; |
|
2402 |
|
|
2403 |
$lxdebug->leave_sub(); |
|
2404 |
} |
|
2405 |
|
|
2406 |
sub adr_header { |
|
2407 |
$lxdebug->enter_sub(); |
|
2408 |
|
|
2409 |
$form->{title} = $locale->text("$form->{title} ADR"); |
|
2410 |
|
|
2411 |
# $locale->text('Add ADR') |
|
2412 |
# $locale->text('Edit ADR') |
|
2413 |
|
|
2414 |
$form->{adr_description} =~ s/\"/"/g; |
|
2415 |
$form->{adr_code} =~ s/\"/"/g; |
|
2416 |
|
|
2417 |
|
|
2418 |
$form->header; |
|
2419 |
|
|
2420 |
print qq| |
|
2421 |
<body> |
|
2422 |
|
|
2423 |
<form method=post action=$form->{script}> |
|
2424 |
|
|
2425 |
<input type=hidden name=id value=$form->{id}> |
|
2426 |
<input type=hidden name=type value=adr> |
|
2427 |
|
|
2428 |
<table width=100%> |
|
2429 |
<tr> |
|
2430 |
<th class=listtop colspan=2>$form->{title}</th> |
|
2431 |
</tr> |
|
2432 |
<tr height="5"></tr> |
|
2433 |
<tr> |
|
2434 |
<th align=right>| . $locale->text('ADR Code') . qq|</th> |
|
2435 |
<td><input name=adr_code size=30 value="$form->{adr_code}"></td> |
|
2436 |
<tr> |
|
2437 |
<tr> |
|
2438 |
<th align=right>| . $locale->text('ADR Description') . qq|</th> |
|
2439 |
<td><input name=adr_description size=60 value="$form->{adr_description}"></td> |
|
2440 |
</tr> |
|
2441 |
<td colspan=2><hr size=3 noshade></td> |
|
2442 |
</tr> |
|
2443 |
</table> |
|
2444 |
|; |
|
2445 |
|
|
2446 |
$lxdebug->leave_sub(); |
|
2447 |
} |
|
2448 |
|
|
2449 |
sub save_adr { |
|
2450 |
$lxdebug->enter_sub(); |
|
2451 |
|
|
2452 |
$form->isblank("adr_description", $locale->text('ADR Description missing!')); |
|
2453 |
$form->isblank("adr_code", $locale->text('ADR Code missing!')); |
|
2454 |
AM->save_adr(\%myconfig, \%$form); |
|
2455 |
$form->redirect($locale->text('ADR saved!')); |
|
2456 |
|
|
2457 |
$lxdebug->leave_sub(); |
|
2458 |
} |
|
2459 |
|
|
2460 |
|
|
2461 |
sub delete_adr { |
|
2462 |
$lxdebug->enter_sub(); |
|
2463 |
|
|
2464 |
AM->delete_adr(\%myconfig, \%$form); |
|
2465 |
$form->redirect($locale->text('ADR deleted!')); |
|
2466 |
|
|
2467 |
$lxdebug->leave_sub(); |
|
2468 |
} |
|
2469 |
|
|
2470 |
|
|
2471 | 2270 |
sub add_payment { |
2472 | 2271 |
$lxdebug->enter_sub(); |
2473 | 2272 |
|
bin/mozilla/ct.pl | ||
---|---|---|
307 | 307 |
$lxdebug->leave_sub(); |
308 | 308 |
} |
309 | 309 |
|
310 |
sub search_adr { |
|
311 |
$lxdebug->enter_sub(); |
|
312 |
|
|
313 |
$form->{title} = $locale->text('ADR Report'); |
|
314 |
|
|
315 |
# use JavaScript Calendar or not |
|
316 |
$form->{jsscript} = $jscalendar; |
|
317 |
$jsscript = ""; |
|
318 |
|
|
319 |
if ($form->{jsscript}) { |
|
320 |
|
|
321 |
# with JavaScript Calendar |
|
322 |
$button1 = qq| |
|
323 |
<td><input name=from id=from size=11 title="$myconfig{dateformat}" value=$form->{from}></td> |
|
324 |
<td><input type=button name=from id="trigger1" value=| |
|
325 |
. $locale->text('button') . qq|></td> |
|
326 |
|; |
|
327 |
$button2 = qq| |
|
328 |
<td width="13"><input name=to id=to size=11 title="$myconfig{dateformat}" value=$form->{to}></td> |
|
329 |
<td width="4"><input type=button name=to id="trigger2" value=| |
|
330 |
. $locale->text('button') . qq|></td></td> |
|
331 |
|; |
|
332 |
|
|
333 |
|
|
334 |
#write Trigger |
|
335 |
$jsscript = |
|
336 |
Form->write_trigger(\%myconfig, "2", |
|
337 |
"from", "BL", |
|
338 |
"trigger1", "to", |
|
339 |
"BL", "trigger2"); |
|
340 |
} else { |
|
341 |
|
|
342 |
# without JavaScript Calendar |
|
343 |
$button1 = |
|
344 |
qq|<td><input name=from size=11 title="$myconfig{dateformat}" value=$form->{from}></td>|; |
|
345 |
$button2 = |
|
346 |
qq|<td width="13"><input name=to size=11 title="$myconfig{dateformat}" value=$form->{to}></td>|; |
|
347 |
} |
|
348 |
|
|
349 |
$form->header; |
|
350 |
|
|
351 |
print qq| |
|
352 |
<body> |
|
353 |
|
|
354 |
<form method=post action=$form->{script}> |
|
355 |
|
|
356 |
|
|
357 |
<table width=100%> |
|
358 |
<tr> |
|
359 |
<th class=listtop>$form->{title}</th> |
|
360 |
</tr> |
|
361 |
<tr height="5"></tr> |
|
362 |
<tr valign=top> |
|
363 |
<td> |
|
364 |
<table> |
|
365 |
<tr> |
|
366 |
<th align=right nowrap>| . $locale->text('Year') . qq|</th> |
|
367 |
<td><input name=year type=input value=$form->{year}></td> |
|
368 |
<tr> |
|
369 |
<th align=right nowrap>| . $locale->text('From') . qq|</th> |
|
370 |
$button1 |
|
371 |
</tr> |
|
372 |
<tr> |
|
373 |
<th align=right nowrap>| . $locale->text('Bis') . qq|</th> |
|
374 |
$button2 |
|
375 |
</tr> |
|
376 |
<tr> |
|
377 |
<td></td> |
|
378 |
<td><input name=format class=radio type=radio value=html checked> | |
|
379 |
. $locale->text('HTML') . qq| |
|
380 |
<input name=format class=radio type=radio value=csv> | |
|
381 |
. $locale->text('CSV') . qq|</td> |
|
382 |
</tr> |
|
383 |
</table> |
|
384 |
</td> |
|
385 |
</tr> |
|
386 |
<tr> |
|
387 |
<td><hr size=3 noshade></td> |
|
388 |
</tr> |
|
389 |
</table> |
|
390 |
$jsscript |
|
391 |
<input type=hidden name=nextsub value=adr_report> |
|
392 |
|
|
393 |
<input type=hidden name=path value=$form->{path}> |
|
394 |
<input type=hidden name=login value=$form->{login}> |
|
395 |
<input type=hidden name=password value=$form->{password}> |
|
396 |
|
|
397 |
<br> |
|
398 |
<input type=submit class=submit name=action value="| |
|
399 |
. $locale->text('Continue') . qq|"> |
|
400 |
</form> |
|
401 |
|
|
402 |
</body> |
|
403 |
</html> |
|
404 |
|; |
|
405 |
$lxdebug->leave_sub(); |
|
406 |
} |
|
407 |
sub adr_report { |
|
408 |
$lxdebug->enter_sub(); |
|
409 |
|
|
410 |
CT->adr(\%myconfig, \%$form); |
|
411 |
|
|
412 |
$form->{title} = $locale->text('ADR Report'); |
|
413 |
if ($form->{from} || $form->{to}) { |
|
414 |
$option = "F?r den Zeitraum $form->{from} bis $form->{to}"; |
|
415 |
} elsif ($form->{year}) { |
|
416 |
$option = "F?r das Jahr $form->{year}"; |
|
417 |
} |
|
418 |
|
|
419 |
if ($form->{format} eq "html") { |
|
420 |
$form->header(); |
|
421 |
print qq| |
|
422 |
<body> |
|
423 |
|
|
424 |
<table width=100%> |
|
425 |
<tr> |
|
426 |
<th class=listtop>$form->{title}</th> |
|
427 |
</tr> |
|
428 |
<tr height="5"></tr> |
|
429 |
<tr> |
|
430 |
<td>$option</td> |
|
431 |
</tr> |
|
432 |
</table>|; |
|
433 |
|
|
434 |
|
|
435 |
@column_index = |
|
436 |
$form->sort_columns(adr_code, |
|
437 |
adr_description, |
|
438 |
sum, |
|
439 |
unit); |
|
440 |
|
|
441 |
|
|
442 |
|
|
443 |
$column_header{adr_code} = |
|
444 |
qq|<th class=listheading>| . $locale->text('ADR Code') . qq|</th>|; |
|
445 |
$column_header{adr_description} = |
|
446 |
qq|<th class=listheading>|. $locale->text('ADR Description'). qq|</th>|; |
|
447 |
$column_header{sum} = |
|
448 |
qq|<th class=listheading>|. $locale->text('Quantity'). qq|</th>|; |
|
449 |
$column_header{unit} = |
|
450 |
qq|<th class=listheading>| . $locale->text('Unit') . qq|</th>|; |
|
451 |
|
|
452 |
print qq| |
|
453 |
|
|
454 |
<table width=100%> |
|
455 |
<tr> |
|
456 |
<td> |
|
457 |
<table width=100%> |
|
458 |
<tr class=listheading> |
|
459 |
|; |
|
460 |
|
|
461 |
map { print "$column_header{$_}\n" } @column_index; |
|
462 |
|
|
463 |
print qq| |
|
464 |
</tr> |
|
465 |
|; |
|
466 |
|
|
467 |
|
|
468 |
foreach $ref (@{ $form->{ADR} }) { |
|
469 |
|
|
470 |
map { $column_data{$_} = "<td>$ref->{$_} </td>" } @column_index; |
|
471 |
|
|
472 |
|
|
473 |
$i++; |
|
474 |
$i %= 2; |
|
475 |
print " |
|
476 |
<tr class=listrow$i> |
|
477 |
"; |
|
478 |
|
|
479 |
map { print "$column_data{$_}\n" } @column_index; |
|
480 |
|
|
481 |
print qq| |
|
482 |
</tr> |
|
483 |
|; |
|
484 |
|
|
485 |
|
|
486 |
} |
|
487 |
|
|
488 |
print qq| |
|
489 |
</table> |
|
490 |
</body> |
|
491 |
</html> |
|
492 |
|; |
|
493 |
} else { |
|
494 |
my $filename = "adr-report-$form->{from}-$form->{to}.csv"; |
|
495 |
if ($form->{year}) { |
|
496 |
$filename = "adr-report-$form->{year}.csv"; |
|
497 |
} |
|
498 |
@column_index = |
|
499 |
$form->sort_columns(adr_code, |
|
500 |
adr_description, |
|
501 |
sum, |
|
502 |
unit); |
|
503 |
|
|
504 |
$tmpfile = qq|ADR Code;ADR Beschreibung;Menge;Einheit\n|; |
|
505 |
foreach $ref (@{ $form->{ADR} }) { |
|
506 |
|
|
507 |
map { $column_data{$_} = qq|"$ref->{$_}"| } @column_index; |
|
508 |
|
|
509 |
$line = ""; |
|
510 |
map { $line .= "$column_data{$_};" } @column_index; |
|
511 |
chomp($line); |
|
512 |
$tmpfile .= qq|$line\n|;; |
|
513 |
} |
|
514 |
|
|
515 |
my $size = length($tmpfile); |
|
516 |
# launch application |
|
517 |
print qq|Content-Type: application/csv |
|
518 |
Content-Disposition: attachment; filename="$filename" |
|
519 |
Content-Length: $size |
|
520 |
|
|
521 |
$tmpfile |
|
522 |
|; |
|
523 |
} |
|
524 |
|
|
525 |
$lxdebug->leave_sub(); |
|
526 |
} |
|
527 |
|
|
528 | 310 |
sub list_names { |
529 | 311 |
$lxdebug->enter_sub(); |
530 | 312 |
|
... | ... | |
1851 | 1633 |
ordnumber, |
1852 | 1634 |
transdate, |
1853 | 1635 |
description, |
1854 |
adr_code, |
|
1855 | 1636 |
qty, |
1856 | 1637 |
unit); |
1857 | 1638 |
|
... | ... | |
1867 | 1648 |
qq|<th class=listheading>| . $locale->text('Invdate') . qq|</th>|; |
1868 | 1649 |
$column_header{description} = |
1869 | 1650 |
qq|<th class=listheading>| . $locale->text('Description') . qq|</th>|; |
1870 |
$column_header{adr_code} = |
|
1871 |
qq|<th class=listheading>| . $locale->text('ADR') . qq|</th>|; |
|
1872 | 1651 |
$column_header{qty} = |
1873 | 1652 |
qq|<th class=listheading>| . $locale->text('Qty') . qq|</th>|; |
1874 | 1653 |
$column_header{unit} = |
bin/mozilla/ic.pl | ||
---|---|---|
2256 | 2256 |
</tr>|; |
2257 | 2257 |
|
2258 | 2258 |
|
2259 |
$form->{selectadr} = "<option></option>"; |
|
2260 |
if (@{ $form->{ADR} }) { |
|
2261 |
foreach $item (@{ $form->{ADR} }) { |
|
2262 |
if ($item->{id} == $form->{adr_id}) { |
|
2263 |
$form->{selectadr} .= |
|
2264 |
"<option value=$item->{id} selected>$item->{adr_code}\n"; |
|
2265 |
} else { |
|
2266 |
$form->{selectadr} .= |
|
2267 |
"<option value=$item->{id}>$item->{adr_code}\n"; |
|
2268 |
} |
|
2269 |
|
|
2270 |
} |
|
2271 |
} |
|
2272 |
|
|
2273 |
$adr = qq| |
|
2274 |
<tr> |
|
2275 |
<th align=right>| . $locale->text('ADR') . qq|</th> |
|
2276 |
<td><select name=adr_id>$form->{selectadr}</select></td> |
|
2277 |
</tr>|; |
|
2278 |
|
|
2279 |
|
|
2280 | 2259 |
# set option |
2281 | 2260 |
foreach $item (qw(IC IC_income IC_expense)) { |
2282 | 2261 |
if ($form->{$item}) { |
... | ... | |
2628 | 2607 |
<table> |
2629 | 2608 |
$buchungsgruppe |
2630 | 2609 |
$linkaccounts |
2631 |
$adr |
|
2632 | 2610 |
</table> |
2633 | 2611 |
</td> |
2634 | 2612 |
<tr> |
bin/mozilla/io.pl | ||
---|---|---|
424 | 424 |
<input type=hidden name="cusordnumber_$i" value="$form->{"cusordnumber_$i"}"> |
425 | 425 |
<input type=hidden name="longdescription_$i" value="$form->{"longdescription_$i"}"> |
426 | 426 |
<input type=hidden name="basefactor_$i" value="$form->{"basefactor_$i"}"> |
427 |
<input type=hidden name="adr_description_$i" value="$form->{"adr_description_$i"}"> |
|
428 | 427 |
|
429 | 428 |
|; |
430 | 429 |
|
... | ... | |
640 | 639 |
<input name="new_longdescription_$i" type=hidden value="$ref->{longdescription}"> |
641 | 640 |
<input name="new_not_discountable_$i" type=hidden value="$ref->{not_discountable}"> |
642 | 641 |
<input name="new_part_payment_id_$i" type=hidden value="$ref->{part_payment_id}"> |
643 |
<input name="new_adr_description_$i" type=hidden value="$ref->{adr_description}"> |
|
644 | 642 |
|
645 | 643 |
<input name="new_id_$i" type=hidden value=$ref->{id}> |
646 | 644 |
|
... | ... | |
703 | 701 |
$sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"}); |
704 | 702 |
|
705 | 703 |
map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } |
706 |
qw(id partnumber description sellprice listprice inventory_accno income_accno expense_accno bin unit weight assembly taxaccounts partsgroup formel alu longdescription not_discountable adr_description);
|
|
704 |
qw(id partnumber description sellprice listprice inventory_accno income_accno expense_accno bin unit weight assembly taxaccounts partsgroup formel alu longdescription not_discountable); |
|
707 | 705 |
if ($form->{"part_payment_id_$i"} ne "") { |
708 | 706 |
$form->{payment_id} = $form->{"part_payment_id_$i"}; |
709 | 707 |
} |
... | ... | |
940 | 938 |
my @a = (); |
941 | 939 |
my $count = 0; |
942 | 940 |
my @flds = ( |
943 |
qw(id partnumber description qty ship sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup payment_id not_discountable shop ve gv buchungsgruppen_id adr_id language_values)
|
|
941 |
qw(id partnumber description qty ship sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup payment_id not_discountable shop ve gv buchungsgruppen_id language_values) |
|
944 | 942 |
); |
945 | 943 |
|
946 | 944 |
|
sql/Pg-upgrade/Pg-upgrade-2.2.0.23-2.2.0.24.sql | ||
---|---|---|
1 |
ALTER TABLE parts DROP COLUMN adr_id; |
|
2 |
DROP TABLE adr; |
Auch abrufbar als: Unified diff
ADR entfernt (kam aus Kundenprojekt und ist nicht fuer die allgemeine Lx-Office-Variante gedacht).