Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3a33f5d3

Von Sven Schöling vor fast 15 Jahren hinzugefügt

  • ID 3a33f5d30ec393cba37441e40dd68e2357970e3e
  • Vorgänger 872f1493
  • Nachfolger 8332f181

Rechnungssuche auf Templates umgestellt (analog zu Aufträgen), und auch hier Autocompletion für Kunden aktiviert.

Unterschiede anzeigen:

bin/mozilla/ar.pl
1269 1269
  # setup customer selection
1270 1270
  $form->all_vc(\%myconfig, "customer", "AR");
1271 1271

  
1272
  if (@{ $form->{all_customer} || [] }) {
1273
    map { $customer .= "<option>$_->{name}--$_->{id}\n" }
1274
      @{ $form->{all_customer} };
1275
    $customer = qq|<select name=customer><option>\n$customer</select>|;
1276
  } else {
1277
    $customer = qq|<input name=customer size=35>|;
1278
  }
1279

  
1280
  # departments
1281
  if (@{ $form->{all_departments} || [] }) {
1282
    $form->{selectdepartment} = "<option>\n";
1283

  
1284
    map {
1285
      $form->{selectdepartment} .=
1286
        "<option>$_->{description}--$_->{id}\n"
1287
    } (@{ $form->{all_departments} || [] });
1288
  }
1289

  
1290
  $department = qq|
1291
        <tr>
1292
	  <th align=right nowrap>| . $locale->text('Department') . qq|</th>
1293
	  <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
1294
	</tr>
1295
| if $form->{selectdepartment};
1296

  
1297
  $form->{title} = $locale->text('AR Transactions');
1298

  
1299
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
1300

  
1301
  # use JavaScript Calendar or not
1272
  $form->{title}    = $locale->text('AR Transactions');
1273
  $form->{fokus}    = "search.customer";
1302 1274
  $form->{jsscript} = 1;
1303
  $jsscript = "";
1304
  if ($form->{jsscript}) {
1305

  
1306
    # with JavaScript Calendar
1307
    $button1 = qq|
1308
       <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1309
       <input type=button name=transdatefrom id="trigger1" value=|
1310
      . $locale->text('button') . qq|></td>
1311
      |;
1312
    $button2 = qq|
1313
       <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1314
       <input type=button name=transdateto name=transdateto id="trigger2" value=|
1315
      . $locale->text('button') . qq|></td>
1316
     |;
1317

  
1318
    #write Trigger
1319
    $jsscript =
1320
      Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger1",
1321
                          "transdateto", "BL", "trigger2");
1322
  } else {
1323

  
1324
    # without JavaScript Calendar
1325
    $button1 = qq|
1326
                              <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
1327
    $button2 = qq|
1328
                              <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
1329
  }
1330 1275

  
1331
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1332
                                   "all" => 1 });
1276
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
1277
                   "departments"  => "ALL_DEPARTMENTS",
1278
                   "customers"    => "ALL_VC");
1333 1279

  
1334
  my %labels = ();
1335
  my @values = ("");
1336
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
1337
    push(@values, $item->{"id"});
1338
    $labels{$item->{"id"}} = $item->{"projectnumber"};
1339
  }
1340
  my $projectnumber =
1341
    NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
1342
                         '-labels' => \%labels));
1280
  # constants and subs for template
1281
  $form->{jsscript}  = 1;
1282
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
1343 1283

  
1344
  $form->{fokus} = "search.customer";
1345 1284
  $form->header;
1346
  $onload = qq|focus()|;
1347
  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
1348
  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
1349
  print qq|
1350
<body onLoad="$onload">
1351

  
1352
<form method=post name="search" action=$form->{script}>
1353

  
1354
<table width=100%>
1355
  <tr><th class=listtop>$form->{title}</th></tr>
1356
  <tr height="5"></tr>
1357
  <tr>
1358
    <td>
1359
      <table>
1360
	<tr>
1361
	  <th align=right>| . $locale->text('Customer') . qq|</th>
1362
	  <td colspan=3>$customer</td>
1363
	</tr>
1364
	$department
1365
	<tr>
1366
	  <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
1367
	  <td colspan=3><input name=invnumber size=20></td>
1368
	</tr>
1369
	<tr>
1370
	  <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
1371
	  <td colspan=3><input name=ordnumber size=20></td>
1372
	</tr>
1373
       <tr>
1374
         <th align=right nowrap>| . $locale->text('Transaction description') . qq|</th>
1375
         <td colspan=3><input name=transaction_description size=40></td>
1376
       </tr>
1377
	<tr>
1378
	  <th align=right nowrap>| . $locale->text('Notes') . qq|</th>
1379
	  <td colspan=3><input name=notes size=40></td>
1380
	</tr>
1381
        <tr>
1382
          <th align="right">| . $locale->text("Project Number") . qq|</th>
1383
          <td colspan="3">$projectnumber</td>
1384
        </tr>
1385
	<tr>
1386
	  <th align=right nowrap>| . $locale->text('From') . qq|</th>
1387
          $button1
1388
	  <th align=right>| . $locale->text('Bis') . qq|</th>
1389
          $button2
1390
	</tr>
1391
	<input type=hidden name=sort value=transdate>
1392
      </table>
1393
    </td>
1394
  </tr>
1395
  <tr>
1396
    <td>
1397
      <table>
1398
	<tr>
1399
	  <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
1400
	  <td>
1401
	    <table width=100%>
1402
	      <tr>
1403
		<td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
1404
		<td nowrap>| . $locale->text('Open') . qq|</td>
1405
		<td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
1406
		<td nowrap>| . $locale->text('Closed') . qq|</td>
1407
	      </tr>
1408
	      <tr>
1409
		<td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
1410
		<td nowrap>| . $locale->text('ID') . qq|</td>
1411
		<td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
1412
		<td nowrap>| . $locale->text('Invoice Number') . qq|</td>
1413
		<td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
1414
		<td nowrap>| . $locale->text('Order Number') . qq|</td>
1415
		<td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
1416
		<td nowrap>| . $locale->text('Invoice Date') . qq|</td>
1417
	      </tr>
1418
	      <tr>
1419
		<td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
1420
		<td nowrap>| . $locale->text('Customer') . qq|</td>
1421
		<td align=right><input name="l_netamount" class=checkbox type=checkbox value=Y></td>
1422
		<td nowrap>| . $locale->text('Amount') . qq|</td>
1423
		<td align=right><input name="l_tax" class=checkbox type=checkbox value=Y></td>
1424
		<td nowrap>| . $locale->text('Tax') . qq|</td>
1425
		<td align=right><input name="l_amount" class=checkbox type=checkbox value=Y checked></td>
1426
		<td nowrap>| . $locale->text('Total') . qq|</td>
1427
	      </tr>
1428
	      <tr>
1429
		<td align=right><input name="l_datepaid" class=checkbox type=checkbox value=Y></td>
1430
		<td nowrap>| . $locale->text('Date Paid') . qq|</td>
1431
		<td align=right><input name="l_paid" class=checkbox type=checkbox value=Y checked></td>
1432
		<td nowrap>| . $locale->text('Paid') . qq|</td>
1433
		<td align=right><input name="l_duedate" class=checkbox type=checkbox value=Y></td>
1434
		<td nowrap>| . $locale->text('Due Date') . qq|</td>
1435
		<td align=right><input name="l_due" class=checkbox type=checkbox value=Y></td>
1436
		<td nowrap>| . $locale->text('Amount Due') . qq|</td>
1437
	      </tr>
1438
	      <tr>
1439
		<td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
1440
		<td nowrap>| . $locale->text('Notes') . qq|</td>
1441
		<td align=right><input name="l_salesman" class=checkbox type=checkbox value=Y></td>
1442
		<td nowrap>| . $locale->text('Salesperson') . qq|</td>
1443
		<td align=right><input name="l_shippingpoint" class=checkbox type=checkbox value=Y></td>
1444
		<td nowrap>| . $locale->text('Shipping Point') . qq|</td>
1445
		<td align=right><input name="l_shipvia" class=checkbox type=checkbox value=Y></td>
1446
		<td nowrap>| . $locale->text('Ship via') . qq|</td>
1447
	      </tr>
1448
	      <tr>
1449
		<td align=right><input name="l_marge_total" class=checkbox type=checkbox value=Y></td>
1450
                <td nowrap> | . $locale->text('Ertrag') . qq|</td>
1451
		<td align=right><input name="l_marge_percent" class=checkbox type=checkbox value=Y></td>
1452
                <td nowrap> | . $locale->text('Ertrag prozentual') . qq|</td>
1453
		<td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
1454
		<td nowrap>| . $locale->text('Employee') . qq|</td>
1455
	      </tr>
1456
	      <tr>
1457
		<td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
1458
		<td nowrap>| . $locale->text('Subtotal') . qq|</td>
1459
		<td align=right><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y></td>
1460
		<td nowrap>| . $locale->text('Project Number') . qq|</td>
1461
		<td align=right><input name="l_transaction_description" class=checkbox type=checkbox value=Y></td>
1462
		<td nowrap>| . $locale->text('Transaction description') . qq|</td>
1463
	      </tr>
1464
          <tr>
1465
        <td colspan=4 align=left><b>| . $locale->text('Customer') . qq| </td>
1466
          </tr>
1467
          <tr>
1468
		<td align=right><input name="l_customernumber" class=checkbox type=checkbox value=Y></td>
1469
		<td nowrap>| . $locale->text('Customer Number') . qq|</td>
1470
		<td align=right><input name="l_country" class=checkbox type=checkbox value=Y></td>
1471
		<td nowrap>| . $locale->text('Country') . qq|</td>
1472
		<td align=right><input name="l_ustid" class=checkbox type=checkbox value=Y></td>
1473
		<td nowrap>| . $locale->text('USt-IdNr.') . qq|</td>
1474
		<td align=right><input name="l_taxzone" class=checkbox type=checkbox value=Y></td>
1475
		<td nowrap>| . $locale->text('Steuersatz') . qq|</td>
1476
          </tr>
1477
          <tr>
1478
		<td align=right><input name="l_payment_terms" class=checkbox type=checkbox value=Y></td>
1479
		<td nowrap>| . $locale->text('Payment Terms') . qq|</td>
1480
		<td align=right><input name="l_charts" class=checkbox type=checkbox value=Y></td>
1481
		<td nowrap>| . $locale->text('Buchungskonto') . qq|</td>
1482
          </tr>
1483

  
1484
	    </table>
1485
	  </td>
1486
	</tr>
1487
      </table>
1488
    </td>
1489
  </tr>
1490
  <tr>
1491
    <td><hr size=3 noshade></td>
1492
  </tr>
1493
</table>
1494

  
1495
<input type=hidden name=nextsub value=$form->{nextsub}>
1496

  
1497
<br>
1498
<input class=submit type=submit name=action value="|
1499
    . $locale->text('Continue') . qq|">
1500

  
1501
</form>
1502

  
1503
</body>
1504

  
1505
$jsscript
1506

  
1507
</html>
1508
|;
1285
  print $form->parse_html_template('ar/search', { %myconfig });
1509 1286

  
1510 1287
  $main::lxdebug->leave_sub();
1511 1288
}

Auch abrufbar als: Unified diff