Skip to content

Commit

Permalink
Merging fix from trunk: Moving to label/button system to show that pa…
Browse files Browse the repository at this point in the history
…rtnumbers are not editable on invoices and orders. Note this has minor workflow breaking changes when Javascript is disabled only. Javascript has been tested in Chrome and Firefox and should work for other browsers. The framework changes should also make elinks more usable for these screens as well

git-svn-id: svn://svn.code.sf.net/p/ledger-smb/code/branches/1.3@5474 4979c152-3d1c-0410-bac9-87ea11338e46
  • Loading branch information
einhverfr committed Jan 4, 2013
1 parent 13f1683 commit f71cd69
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog for 1.3.28
* Fixing is_zero errors on ar/ap transaction screens w/tax incldued (Chris T)
* Fixing csv ar transactions not showing taxes (Chris T, 3589640)
* Fixing demo quotations having descriptions taking too much space (Chris T)
* Moved to label/button system for deleting lines on invoices (Chris T)

Changelog for 1.3.27
* Detect whether ledgersmb.conf exists during Makefile.PL run and create if
Expand Down
12 changes: 11 additions & 1 deletion bin/io.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
# $locale->text('Oct')
# $locale->text('Nov')
# $locale->text('Dec')
#

sub _calc_taxes {
$form->{subtotal} = $form->{invsubtotal};
Expand Down Expand Up @@ -339,8 +340,17 @@ sub display_row {

$column_data{runningnumber} =
qq|<td><input name="runningnumber_$i" size=3 value=$i></td>|;
$column_data{partnumber} =
if ($form->{"partnumber_$i"}){
$column_data{partnumber} =
qq|<td> $form->{"partnumber_$i"}
<button type="submit" class="submit" value="$i"
name="delete_line">X</button>
<input type="hidden" name="partnumber_$i"
value="$form->{"partnumber_$i"}" /></td>|;
} else {
$column_data{partnumber} =
qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}" accesskey="$i" title="[Alt-$i]">$skunumber</td>|;
}
$column_data{qty} =
qq|<td align=right><input name="qty_$i" title="$form->{"onhand_$i"}" size="5" value="|
. $form->format_amount( \%myconfig, $form->{"qty_$i"} )
Expand Down
14 changes: 13 additions & 1 deletion bin/ir.pl
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ sub prepare_invoice {

sub form_header {

$form->{nextsub} = 'update';

# set option selected
for (qw(AP currency)) {
Expand Down Expand Up @@ -408,16 +409,26 @@ sub form_header {
print qq|
<body onLoad="document.forms[0].${focus}.focus()" />
| . $form->open_status_div . qq|
<script>
function on_return_submit(){
if (window.event.keyCode == 13){
document.forms[0].submit()
}
}
</script>
<form method=post action="$form->{script}" onkeypress="on_return_submit()">
<form method=post action="$form->{script}">
|;
if ($form->{notice}){
print qq|$form->{notice}<br/>|;
}
$form->{vc} = "vendor";
$form->{nextsub} = 'update';
$form->hide_form(
qw(id title vc type terms creditlimit creditremaining closedto locked
shipped oldtransdate recurring reverse batch_id subtype form_id)
shipped oldtransdate recurring reverse batch_id subtype form_id
nextsub)
);

print qq|
Expand Down Expand Up @@ -1055,6 +1066,7 @@ sub update {
if ( $form->{import_text} ) {
&import_text;
}
delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
$form->{exchangerate} =
$form->parse_amount( \%myconfig, $form->{exchangerate} );

Expand Down
15 changes: 12 additions & 3 deletions bin/is.pl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ sub prepare_invoice {
}

sub form_header {
$form->{nextsub} = 'update';

# set option selected
for (qw(AR currency)) {
Expand Down Expand Up @@ -444,15 +445,21 @@ sub form_header {
print qq|
<body onLoad="document.forms[0].${focus}.focus()" />
| . $form->open_status_div . qq|
<form method=post action="$form->{script}">
<script>
function on_return_submit(){
if (window.event.keyCode == 13){
document.forms[0].submit()
}
}
</script>
<form method=post action="$form->{script}" onkeypress="on_return_submit()">
|;

$form->hide_form(
qw(form_id id type printed emailed queued title vc terms discount
creditlimit creditremaining tradediscount business closedto locked
shipped oldtransdate recurring reverse batch_id subtype
meta_number)
meta_number nextsub)
);

if ($form->{notice}){
Expand Down Expand Up @@ -1096,6 +1103,8 @@ sub form_footer {

sub update {
on_update();#TODO meaning ?
delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};

$form->{taxes} = {};
$form->{exchangerate} =
$form->parse_amount( \%myconfig, $form->{exchangerate} );
Expand Down
14 changes: 12 additions & 2 deletions bin/oe.pl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ sub prepare_order {

sub form_header {


$form->{nextsub} = 'update';

$checkedopen = ( $form->{closed} ) ? "" : "checked";
$checkedclosed = ( $form->{closed} ) ? "checked" : "";
Expand Down Expand Up @@ -583,6 +583,14 @@ sub form_header {
print qq|
<body onLoad="document.forms[0].${focus}.focus()" />
| . $form->open_status_div . qq|
<script>
function on_return_submit(){
if (window.event.keyCode == 13){
document.forms[0].submit()
}
}
</script>
<form method=post action="$form->{script}" onkeypress="on_return_submit()">
<form method=post action="$form->{script}">
|;
Expand All @@ -592,7 +600,7 @@ sub form_header {
}
$form->hide_form(qw(entity_control_code meta_number));
$form->hide_form(
qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id)
qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id nextsub)
);

print qq|
Expand Down Expand Up @@ -967,7 +975,9 @@ sub form_footer {
}

sub update {
$form->{nextsub} = 'update';

delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
if ( $form->{type} eq 'generate_purchase_order' ) {

for ( 1 .. $form->{rowcount} ) {
Expand Down
1 change: 1 addition & 0 deletions old-handler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
$locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} )
or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" );

$form->{action} = $form->{nextsub} if (!$form->{action} and $form->{nextsub});

# we use $script for the language module
$form->{script} = $script;
Expand Down

0 comments on commit f71cd69

Please sign in to comment.