Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ddaf7f50

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

  • ID ddaf7f5082fe6e53015a8f3e6ea96ac8f600930a
  • Vorgänger c061f307
  • Nachfolger 66022cbd

Einkaufsrechnungen Suche -> Templates

Unterschiede anzeigen:

bin/mozilla/ap.pl
1202 1202
sub search {
1203 1203
  $main::lxdebug->enter_sub();
1204 1204

  
1205
  $main::auth->assert('general_ledger | invoice_edit');
1206

  
1205 1207
  my $form     = $main::form;
1206 1208
  my %myconfig = %main::myconfig;
1207 1209
  my $locale   = $main::locale;
1208
  my $cgi      = $main::cgi;
1209

  
1210
  $main::auth->assert('general_ledger | vendor_invoice_edit');
1211 1210

  
1212
  # setup vendor selection
1211
  # setup customer selection
1213 1212
  $form->all_vc(\%myconfig, "vendor", "AP");
1214 1213

  
1215
  my $vendor;
1216
  if (@{ $form->{all_vendor} || [] }) {
1217
    map { $vendor .= "<option>$_->{name}--$_->{id}\n" }
1218
      @{ $form->{all_vendor} };
1219
    $vendor = qq|<select name=vendor><option>\n$vendor\n</select>|;
1220
  } else {
1221
    $vendor = qq|<input name=vendor size=35>|;
1222
  }
1223

  
1224
  # departments
1225
  if (@{ $form->{all_departments} || [] }) {
1226
    $form->{selectdepartment} = "<option>\n";
1227

  
1228
    map {
1229
      $form->{selectdepartment} .=
1230
        "<option>$_->{description}--$_->{id}\n"
1231
    } (@{ $form->{all_departments} || [] });
1232
  }
1233

  
1234
  my $department = qq|
1235
	<tr>
1236
	  <th align=right nowrap>| . $locale->text('Department') . qq|</th>
1237
	  <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
1238
	</tr>
1239
| if $form->{selectdepartment};
1240

  
1241
  $form->{title} = $locale->text('AP Transactions');
1242

  
1243
  # use JavaScript Calendar or not
1214
  $form->{title}    = $locale->text('AP Transactions');
1215
  $form->{fokus}    = "search.vendor";
1244 1216
  $form->{jsscript} = 1;
1245
  my $jsscript = "";
1246
  my ($button1, $button2);
1247
  if ($form->{jsscript}) {
1248 1217

  
1249
    # with JavaScript Calendar
1250
    $button1 = qq|
1251
       <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1252
       <input type=button name=transdatefrom id="trigger1" value=|
1253
      . $locale->text('button') . qq|></td>
1254
      |;
1255
    $button2 = qq|
1256
       <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
1257
       <input type=button name=transdateto name=transdateto id="trigger2" value=|
1258
      . $locale->text('button') . qq|></td>
1259
     |;
1260

  
1261
    #write Trigger
1262
    $jsscript =
1263
      Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger1",
1264
                          "transdateto", "BL", "trigger2");
1265
  } else {
1266

  
1267
    # without JavaScript Calendar
1268
    $button1 = qq|
1269
                              <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
1270
    $button2 = qq|
1271
                              <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
1272
  }
1218
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
1219
                   "departments"  => "ALL_DEPARTMENTS",
1220
                   "vendors"      => "ALL_VC");
1273 1221

  
1274
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1275
                                   "all" => 1 });
1222
  # constants and subs for template
1223
  $form->{jsscript}  = 1;
1224
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
1276 1225

  
1277
  my %labels = ();
1278
  my @values = ("");
1279
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
1280
    push(@values, $item->{"id"});
1281
    $labels{$item->{"id"}} = $item->{"projectnumber"};
1282
  }
1283
  my $projectnumber =
1284
    NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
1285
                         '-labels' => \%labels));
1286
  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
1287 1226
  $form->header;
1288
  my $onload = qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
1289
  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
1290
  print qq|
1291
<body onLoad="$onload">
1292

  
1293
<form method=post action=$form->{script}>
1294

  
1295
<table width=100%>
1296
  <tr>
1297
    <th class=listtop>$form->{title}</th>
1298
  </tr>
1299
  <tr height="5"></tr>
1300
  <tr>
1301
    <td>
1302
      <table>
1303
	<tr>
1304
	  <th align=right>| . $locale->text('Vendor') . qq|</th>
1305
	  <td colspan=3>$vendor</td>
1306
	</tr>
1307
	$department
1308
	<tr>
1309
	  <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
1310
	  <td colspan=3><input name=invnumber size=20></td>
1311
	</tr>
1312
	<tr>
1313
	  <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
1314
	  <td colspan=3><input name=ordnumber size=20></td>
1315
	</tr>
1316
	<tr>
1317
	  <th align=right nowrap>| . $locale->text('Notes') . qq|</th>
1318
	  <td colspan=3><input name=notes size=40></td>
1319
	</tr>
1320
        <tr>
1321
          <th align="right">| . $locale->text("Project Number") . qq|</th>
1322
          <td colspan="3">$projectnumber</td>
1323
        </tr>
1324
	<tr>
1325
	  <th align=right nowrap>| . $locale->text('From') . qq|</th>
1326
	  $button1
1327
	  <th align=right>| . $locale->text('Bis') . qq|</th>
1328
          $button2
1329
	</tr>
1330
        <input type=hidden name=sort value=transdate>
1331
      </table>
1332
    </td>
1333
  </tr>
1334
  <tr>
1335
    <td>
1336
      <table>
1337
	<tr>
1338
	  <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
1339
	  <td>
1340
	    <table width=100%>
1341
	      <tr>
1342
		<td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
1343
		<td nowrap>| . $locale->text('Open') . qq|</td>
1344
		<td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
1345
		<td nowrap>| . $locale->text('Closed') . qq|</td>
1346
	      </tr>
1347
	      <tr>
1348
		<td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
1349
		<td nowrap>| . $locale->text('ID') . qq|</td>
1350
		<td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
1351
		<td nowrap>| . $locale->text('Invoice Number') . qq|</td>
1352
		<td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
1353
		<td nowrap>| . $locale->text('Order Number') . qq|</td>
1354
	      </tr>
1355
	      <tr>
1356
		<td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
1357
		<td nowrap>| . $locale->text('Vendor') . qq|</td>
1358
		<td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
1359
		<td nowrap>| . $locale->text('Invoice Date') . qq|</td>
1360
		<td align=right><input name="l_netamount" class=checkbox type=checkbox value=Y></td>
1361
		<td nowrap>| . $locale->text('Amount') . qq|</td>
1362
	      </tr>
1363
	      <tr>
1364
		<td align=right><input name="l_tax" class=checkbox type=checkbox value=Y></td>
1365
		<td nowrap>| . $locale->text('Tax') . qq|</td>
1366
		<td align=right><input name="l_amount" class=checkbox type=checkbox value=Y checked></td>
1367
		<td nowrap>| . $locale->text('Total') . qq|</td>
1368
		<td align=right><input name="l_datepaid" class=checkbox type=checkbox value=Y></td>
1369
		<td nowrap>| . $locale->text('Date Paid') . qq|</td>
1370
	      </tr>
1371
	      <tr>
1372
		<td align=right><input name="l_paid" class=checkbox type=checkbox value=Y checked></td>
1373
		<td nowrap>| . $locale->text('Paid') . qq|</td>
1374
		<td align=right><input name="l_duedate" class=checkbox type=checkbox value=Y></td>
1375
		<td nowrap>| . $locale->text('Due Date') . qq|</td>
1376
		<td align=right><input name="l_due" class=checkbox type=checkbox value=Y></td>
1377
		<td nowrap>| . $locale->text('Amount Due') . qq|</td>
1378
	      </tr>
1379
	      <tr>
1380
		<td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
1381
		<td nowrap>| . $locale->text('Notes') . qq|</td>
1382
		<td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
1383
		<td nowrap>| . $locale->text('Employee') . qq|</td>
1384
	      </tr>
1385
	      <tr>
1386
		<td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
1387
		<td nowrap>| . $locale->text('Subtotal') . qq|</td>
1388
		<td align=right><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y></td>
1389
		<td nowrap>| . $locale->text('Project Number') . qq|</td>
1390
	      </tr>
1391
          <tr>
1392
        <td colspan=4 align=left><b>| . $locale->text('Vendor') . qq| </td>
1393
          </tr>
1394
          <tr>
1395
		<td align=right><input name="l_vendornumber" class=checkbox type=checkbox value=Y></td>
1396
		<td nowrap>| . $locale->text('Vendor Number') . qq|</td>
1397
		<td align=right><input name="l_country" class=checkbox type=checkbox value=Y></td>
1398
		<td nowrap>| . $locale->text('Country') . qq|</td>
1399
		<td align=right><input name="l_ustid" class=checkbox type=checkbox value=Y></td>
1400
		<td nowrap>| . $locale->text('USt-IdNr.') . qq|</td>
1401
		<td align=right><input name="l_taxzone" class=checkbox type=checkbox value=Y></td>
1402
		<td nowrap>| . $locale->text('Steuersatz') . qq|</td>
1403
          </tr>
1404
          <tr>
1405
		<td align=right><input name="l_payment_terms" class=checkbox type=checkbox value=Y></td>
1406
		<td nowrap>| . $locale->text('Payment Terms') . qq|</td>
1407
		<td align=right><input name="l_charts" class=checkbox type=checkbox value=Y></td>
1408
		<td nowrap>| . $locale->text('Buchungskonto') . qq|</td>
1409
          </tr>
1410
	    </table>
1411
	  </td>
1412
	</tr>
1413
      </table>
1414
    </td>
1415
  </tr>
1416
  <tr>
1417
    <td><hr size=3 noshade></td>
1418
  </tr>
1419
</table>
1420

  
1421
$jsscript
1422

  
1423
<br>
1424
<input type=hidden name=nextsub value=$form->{nextsub}>
1425

  
1426
<input class=submit type=submit name=action value="|
1427
    . $locale->text('Continue') . qq|">
1428
</form>
1429

  
1430
</body>
1431
</html>
1432
|;
1227
  print $form->parse_html_template('ap/search', { %myconfig });
1433 1228

  
1434 1229
  $main::lxdebug->leave_sub();
1435 1230
}

Auch abrufbar als: Unified diff