}
}
- if ($form->{type} =~ /(sales|ship)_(order|quotation)/) {
+ if ($form->{type} =~ /sales_(order|quotation)/) {
IS->get_customer(\%myconfig, \%$form);
#quote all_vendor Bug 133
#quote select[customer|vendor] Bug 133
$form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"});
+ my @old_project_ids = ($form->{"globalproject_id"});
+ map({ push(@old_project_ids, $form->{"project_id_$_"})
+ if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+
$form->get_lists("contacts" => "ALL_CONTACTS",
- "shipto" => "ALL_SHIPTO");
+ "shipto" => "ALL_SHIPTO",
+ "projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids });
my (%labels, @values);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
my $contact =
- $cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"cp_id"});
+ NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"cp_id"}));
%labels = ();
@values = ("");
my $shipto = qq|
<th align=right>| . $locale->text('Shipping Address') . qq|</th>
<td>| .
- $cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"shipto_id"})
+ NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
. qq|</td>|;
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+ my $globalprojectnumber =
+ NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
+ '-labels' => \%labels,
+ '-default' => $form->{"globalproject_id"}));
+
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
$openclosed
$employee
$ordnumber
+ <tr>
+ <th width="70%" align="right" nowrap>| . $locale->text('Project Number') . qq|</th>
+ <td>$globalprojectnumber</td>
+ </tr>
</table>
</td>
</tr>
&check_name($form->{vc});
- &check_project;
-
$buysell = 'buy';
$buysell = 'sell' if ($form->{vc} eq 'vendor');
$form->{exchangerate} = $exchangerate
<td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
}
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 1 });
+
+ my %labels = ();
+ my @values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+ my $projectnumber =
+ NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
+ '-labels' => \%labels));
+
$form->header;
print qq|
<th align=right>$vclabel</th>
<td colspan=3>$vc</td>
</tr>
- $warehouse
$department
<tr>
<th align=right>$ordlabel</th>
<td colspan=3><input name="$ordnumber" size=20></td>
</tr>
+ <tr>
+ <th align="right">| . $locale->text("Project Number") . qq|</th>
+ <td colspan="3">$projectnumber</td>
+ </tr>
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
$button1
<td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
. $locale->text('Ship via') . qq|</td>
+ <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
</tr>
<tr>
<td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
. $locale->text('Tax') . qq|</td>
<td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
. $locale->text('Total') . qq|</td>
+ <td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> |
+ . $locale->text('Project Number') . qq|</td>
</tr>
<tr>
<td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
$number = $form->escape($form->{$ordnumber});
$name = $form->escape($form->{ $form->{vc} });
$department = $form->escape($form->{department});
- $warehouse = $form->escape($form->{warehouse});
# construct href
$href =
- "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department&warehouse=$warehouse";
+ "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
# construct callback
$number = $form->escape($form->{$ordnumber}, 1);
$name = $form->escape($form->{ $form->{vc} }, 1);
$department = $form->escape($form->{department}, 1);
- $warehouse = $form->escape($form->{warehouse}, 1);
$callback =
- "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department&warehouse=$warehouse";
+ "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department";
@columns =
$form->sort_columns("transdate", "reqdate", "id", "$ordnumber",
"name", "netamount", "tax", "amount",
- "curr", "employee", "shipvia", "open",
- "closed", "delivered");
+ "curr", "employee", "shipvia", "globalprojectnumber",
+ "open", "closed", "delivered");
$form->{l_open} = $form->{l_closed} = "Y"
if ($form->{open} && $form->{closed});
qq|<th><a class=listheading href=$href&sort=shipvia>|
. $locale->text('Ship via')
. qq|</a></th>|;
+ $column_header{globalprojectnumber} =
+ qq|<th class="listheading">| . $locale->text('Project Number') . qq|</th>|;
$column_header{open} =
qq|<th class=listheading>| . $locale->text('O') . qq|</th>|;
$column_header{closed} =
$option = $locale->text(ucfirst $form->{vc});
$option .= " : $form->{$form->{vc}}";
}
- if ($form->{warehouse}) {
- ($warehouse) = split /--/, $form->{warehouse};
- $option .= "\n<br>" if ($option);
- $option .= $locale->text('Warehouse');
- $option .= " : $warehouse";
- }
if ($form->{department}) {
$option .= "\n<br>" if ($option);
($department) = split /--/, $form->{department};
}
$action = "edit";
- $action = "ship_receive" if ($form->{type} =~ /(ship|receive)_order/);
-
- $warehouse = $form->escape($form->{warehouse});
foreach $oe (@{ $form->{OE} }) {
$form->{rowcount} = ++$j;
$column_data{reqdate} = "<td>$oe->{reqdate} </td>";
$column_data{$ordnumber} =
- "<td><a href=oe.pl?path=$form->{path}&action=$action&type=$form->{type}&id=$oe->{id}&warehouse=$warehouse&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}</a></td>";
+ "<td><a href=oe.pl?path=$form->{path}&action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}</a></td>";
$column_data{name} = "<td>$oe->{name}</td>";
$column_data{employee} = "<td>$oe->{employee} </td>";
$column_data{shipvia} = "<td>$oe->{shipvia} </td>";
+ $column_data{globalprojectnumber} = "<td>" . H($oe->{globalprojectnumber}) . "</td>";
if ($oe->{closed}) {
$column_data{closed} = "<td align=center>X</td>";
. $locale->text('Continue') . qq|">
<input type="hidden" name="nextsub" value="edit">
<input type="hidden" name="type" value="$form->{type}">
- <input type="hidden" name="warehouse" value="$warehouse">
<input type="hidden" name="vc" value="$form->{vc}">
<input type="hidden" name="login" value="$form->{login}">
<input type="hidden" name="password" value="$form->{password}">
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
-|;
- if ($form->{type} !~ /(ship|receive)_order/) {
- print qq|
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">|;
- }
-
- print qq|
</form>
</body>