Skip to content

Commit

Permalink
Add variable to indicate whether or not Information fields apply to t…
Browse files Browse the repository at this point in the history
…he upload

Correct title variable usage for Inventory import
  • Loading branch information
aungzwin10 committed Dec 8, 2021
1 parent a11e6dc commit 0e5d824
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion UI/import_csv/import_csv.html
Expand Up @@ -13,9 +13,10 @@
name = "type"
value = request.type
} %]
[% IF request.multi %]
[% IF request.show_batch_title %]
<div class="listtop">[% text('Batch Information') %]</div>
[% END %]
[% IF request.show_input %]
<div data-dojo-type="lsmb/layout/TableContainer"
data-dojo-props="cols:1">
<div class="inputrow" id = "referencerow">
Expand Down Expand Up @@ -54,6 +55,7 @@
} %]
</div>
</div>
[% END %]
<div class="inputrow" id="filerow">
[% PROCESS input element_data = {
name = "import_file"
Expand Down
4 changes: 2 additions & 2 deletions UI/import_csv/import_inventory_csv.html
@@ -1,7 +1,7 @@
[% PROCESS 'elements.html' %]
<body class="lsmb [% dojo_theme %]">
<div class="listtop">[% title %]</div>
<div class="info">[% info %]</div>
<div class="listtop">[% request.title %]</div>
<div class="info">[% request.info %]</div>
<form data-dojo-type="lsmb/Form" action="[% request.script %]" method="post" enctype="multipart/form-data">
<div class="inputrow" id="ar-account-row">
[% PROCESS select element_data = {
Expand Down
5 changes: 3 additions & 2 deletions lib/LedgerSMB/Scripts/import_csv.pm
Expand Up @@ -106,7 +106,7 @@ my $header_info = {
title => 'Inventory Batch Import',
info => ''
},
goods => {
parts => {
title => 'Goods Import',
info => ''
},
Expand Down Expand Up @@ -648,7 +648,8 @@ sub begin_import {

$request->{title} = $header_info->{$request->{type}}->{title};
$request->{info} = $header_info->{$request->{type}}->{info};
$request->{multi} = 1 if $request->{type} =~ s/multi$//;
$request->{show_batch_title} = 1 if $request->{type} =~ m/multi$/;
$request->{show_input} = 1 if ($request->{type} =~ m/multi$/ or $request->{type} eq 'gl');

# $request->{page_id} = $request->{type};
# $request->{page_id} =~ s/_/-/;
Expand Down

0 comments on commit 0e5d824

Please sign in to comment.