<table>
<tr>
<th align=right nowrap>| . $locale->text('Vendor') . qq|</th>
- <td colspan=3>$vendor <input type="button" value="?" onclick="show_vc_details('vendor')"></td>
+ <td colspan=3>$vendor <input type="button" value="D" onclick="show_vc_details('vendor')"></td>
<input type=hidden name=selectvendor value="$form->{selectvendor}">
<input type=hidden name=oldvendor value="$form->{oldvendor}">
<input type=hidden name=vendor_id value="$form->{vendor_id}">
$column_data{AP_paid} = "<th>" . $locale->text('Account') . "</th>";
$column_data{source} = "<th>" . $locale->text('Source') . "</th>";
$column_data{memo} = "<th>" . $locale->text('Memo') . "</th>";
- $column_data{paid_project_id} = "<th>" . $locale->text('Project Number') . "</th>";
+ $column_data{paid_project_id} = "<th>" . $locale->text('Project Number') . "</th>";
print "
<tr>
$column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
$column_data{"datepaid_$i"} =
qq|<td align=center><input name="datepaid_$i" id="datepaid_$i" size=11 title="($myconfig{'dateformat'})" value="$form->{"datepaid_$i"}" onBlur=\"check_right_date_format(this)\">
- <input type="button" name="datepaid_$i" id="trigger_datepaid_$i" value="?"></td>|;
+ <input type="button" name="datepaid_$i" id="trigger_datepaid_$i" value="| . $locale->text('Details (one letter abbreviation)') . qq|"></td>|;
$column_data{"source_$i"} =
qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
$column_data{"memo_$i"} =
print qq| <input type="button" class="submit" onclick="set_history_window($form->{id});" name="history" id="history" value="| . $locale->text('history') . qq|"> |;
}
# /button for saving history
- # mark_as_paid button
- if($form->{id} ne "") {
+ # mark_as_paid button
+ if($form->{id} ne "") {
print qq| <input type="submit" class="submit" name="action" value="| . $locale->text('mark as paid') . qq|"> |;
}
# /mark_as_paid button
$auth->assert('general_ledger');
- &mark_as_paid_common(\%myconfig,"ap");
+ &mark_as_paid_common(\%myconfig,"ap");
$lxdebug->leave_sub();
}
$form->{invtotal} = 0;
+ delete @{ $form }{ grep { m/^tax_\d+$/ } keys %{ $form } };
+
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
- @flds = qw(amount AP_amount projectnumber oldprojectnumber project_id);
+ @flds = qw(amount AP_amount projectnumber oldprojectnumber project_id taxchart);
$count = 0;
for $i (1 .. $form->{rowcount}) {
$form->{"amount_$i"} =
$form->{exchangerate} = $form->{forex} if $form->{forex};
$form->{invdate} = $form->{transdate};
- $save_AP = $form->{AP};
- &check_name("vendor");
- $form->{AP} = $save_AP;
+ my %saved_variables = map +( $_ => $form->{$_} ), qw(AP AP_amount_1 taxchart_1);
+
+ my $vendor_changed = &check_name("vendor");
+
+ $form->{AP} = $saved_variables{AP};
+ if ($saved_variables{AP_amount_1} =~ m/.--./) {
+ map { $form->{$_} = $saved_variables{$_} } qw(AP_amount_1 taxchart_1);
+ } else {
+ delete $form->{taxchart_1};
+ }
$form->{rowcount} = $count + 1;
$form->{oldtotalpaid} = $totalpaid;
# notes
- $form->{notes} = $form->{intnotes};
+ $form->{notes} = $form->{intnotes} if $vendor_changed;
&display_form;
$form->{addition} = "POSTED";
$form->save_history($form->dbconnect(\%myconfig));
}
- # /saving the history
+ # /saving the history
remove_draft() if $form->{remove_draft};
$form->redirect($locale->text('Transaction posted!'));
}
$form->{addition} = "POSTED AS NEW";
$form->save_history($form->dbconnect(\%myconfig));
}
- # /saving the history
+ # /saving the history
&post;
$lxdebug->leave_sub();
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
- # /saving the history
+ # /saving the history
$form->redirect($locale->text('Transaction deleted!'));
}
$form->error($locale->text('Cannot delete transaction!'));
<td align=right><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y></td>
<td nowrap>| . $locale->text('Project Number') . qq|</td>
</tr>
+ <tr>
+ <td colspan=4 align=left><b>| . $locale->text('Vendor') . qq| </td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_vendornumber" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Vendor Number') . qq|</td>
+ <td align=right><input name="l_country" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Country') . qq|</td>
+ <td align=right><input name="l_ustid" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('USt-IdNr.') . qq|</td>
+ <td align=right><input name="l_taxzone" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Steuersatz') . qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_payment_terms" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Payment Terms') . qq|</td>
+ <td align=right><input name="l_charts" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>| . $locale->text('Buchungskonto') . qq|</td>
+ </tr>
</table>
</td>
</tr>
my @columns =
qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid
- due duedate transaction_description notes employee globalprojectnumber);
+ due duedate transaction_description notes employee globalprojectnumber
+ vendornumber country ustid taxzone payment_terms charts);
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto);
'notes' => { 'text' => $locale->text('Notes'), },
'employee' => { 'text' => $locale->text('Salesperson'), },
'globalprojectnumber' => { 'text' => $locale->text('Project Number'), },
+ 'vendornumber' => { 'text' => $locale->text('Vendor Number'), },
+ 'country' => { 'text' => $locale->text('Country'), },
+ 'ustid' => { 'text' => $locale->text('USt-IdNr.'), },
+ 'taxzone' => { 'text' => $locale->text('Steuersatz'), },
+ 'payment_terms' => { 'text' => $locale->text('Payment Terms'), },
+ 'charts' => { 'text' => $locale->text('Buchungskonto'), },
);
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description)) {
$form->{addition} = "STORNO";
$form->save_history($form->dbconnect(\%myconfig));
}
- # /saving the history
+ # /saving the history
- $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id});
+ $form->redirect(sprintf $locale->text("Transaction %d cancelled."), $form->{storno_id});
$lxdebug->leave_sub();
}