[set page_title]Quickbooks Item Import[/set] [set table_perm]=i[/set] [set help_name]quickbooks.items[/set] [set icon_name]icon_config.gif[/set] @_UI_STD_HEAD_@ [if type=explicit compare="[value-extended name=upload_file test=isfile]"] [title-bar]Import of table [cgi mv_data_file]: [value-extended name=upload_file outfile="upload/[cgi mv_data_table].[cgi ui_upload_ext]" yes=Succeeded no=FAILED ][/title-bar]

[if type=file term="upload/[cgi mv_data_table].[cgi ui_upload_ext]"] [check-upload file="[cgi mv_data_table].[cgi ui_upload_ext]" same=1] [/if] [if type=file term="products/[cgi mv_data_table].[cgi ui_upload_ext]"] [flag type=write table="[cgi mv_data_table]"] [/if] [if cgi ui_upload_ext eq add] [import-quicken-items type=items file="products/[cgi mv_data_table].add" move=1 add=1 dir=backup] [elsif cgi ui_upload_ext eq update] [import-quicken-items type=items file="products/[cgi mv_data_table].update" move=1 dir=backup] [/elsif] [/if] [/if] [calc] return if ! $CGI->{mv_data_table}; $Values->{mv_data_table} = $CGI->{mv_data_table}; return; [/calc]

Field mapping

INVITEM types to select:

[perl tables="[either]__UI_QBITEM_TABLES__[or]products inventory[/either]"] my @tables; @tables = split /[\0\s,]+/, ('__UI_QBITEM_TABLES__' || 'products inventory'); @tables = grep /\S/, @tables; my $default_map = $Variable->{UI_QBITEM_MAP} || <<EOF; products:title NAME products:sku REFNUM products:display INVITEMTYPE products:description DESC products:category CUSTFLD1 products:image CUSTFLD2 products:weight CUSTFLD3 products:color CUSTFLD4 products:size CUSTFLD5 inventory:sku REFNUM inventory:quantity QNTY inventory:account ACCNT inventory:cogs_account COGSACCNT products:price PRICE products:nontaxable !TAXABLE EOF %fmap = grep /\S/, split /\s+/, $default_map; my $out = ''; my $tab; foreach $tab (@tables) { my $db = $Db{$tab}; next if ! $db; $out .= <<EOF; <TABLE>

$tab
EOF for($db->columns()) { $out .= <<EOF;
$_ |
EOF } $out .= "

"; } return $out; [/perl]
@_UI_STD_FOOTER_@