[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3084] addons/1.3/import_trans/trunk



Revision: 3084
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3084&view=rev
Author:   einhverfr
Date:     2010-10-04 16:31:32 +0000 (Mon, 04 Oct 2010)

Log Message:
-----------
Moving AP multi import from drafts to a batch

Modified Paths:
--------------
    addons/1.3/import_trans/trunk/UI/import_trans/import_trans.html
    addons/1.3/import_trans/trunk/scripts/import_trans.pl

Modified: addons/1.3/import_trans/trunk/UI/import_trans/import_trans.html
===================================================================
--- addons/1.3/import_trans/trunk/UI/import_trans/import_trans.html	2010-10-03 23:50:11 UTC (rev 3083)
+++ addons/1.3/import_trans/trunk/UI/import_trans/import_trans.html	2010-10-04 16:31:32 UTC (rev 3084)
@@ -13,7 +13,9 @@
     name = "type"
     value = type
 } ?>
-<?lsmb IF !multi ?>
+<?lsmb IF multi ?>
+<div class="listtop"><?lsmb text('Batch Information') ?></div>
+<?lsmb END ?>
 <div class="inputrow" id = "referencerow">
 <?lsmb PROCESS input element_data = {
     type  = "text"
@@ -42,7 +44,6 @@
      value = transdate
      size = 12
 } ?>
-<?lsmb END # IF !multi ?>
 <div class="inputrow" id="filerow">
 <?lsmb PROCESS input element_data = {
        name = "import_file"

Modified: addons/1.3/import_trans/trunk/scripts/import_trans.pl
===================================================================
--- addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-03 23:50:11 UTC (rev 3083)
+++ addons/1.3/import_trans/trunk/scripts/import_trans.pl	2010-10-04 16:31:32 UTC (rev 3084)
@@ -62,7 +62,12 @@
                 },
    ap_multi => sub {
                    use LedgerSMB::AA;
+                   use LedgerSMB::Batch;
                    my ($request, $entries) = @_;
+                   my $batch = LedgerSMB::Batch->new({base => $request});
+                   $batch->{batch_number} = $request->{reference};
+                   $batch->{batch_class} = 1;
+                   $batch->create(); 
                    # Necessary to test things are found before starting to 
                    # import! -- CT
                    my $acst = $request->{dbh}->prepare(
@@ -87,6 +92,7 @@
                        my $form = Form->new();
                        $form->{dbh} = $request->{dbh};
                        $form->{rowcount} = 1;
+                       $form->{batch_id} = $batch->{id};
                        $form->{vendornumber} = shift @$ref;
                        $form->{amount_1} = shift @$ref;
                        next if $form->{amount_1} !~ /\d/;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.