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

SF.net SVN: ledger-smb:[3038] addons/1.3



Revision: 3038
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3038&view=rev
Author:   einhverfr
Date:     2010-08-04 21:23:30 +0000 (Wed, 04 Aug 2010)

Log Message:
-----------
Correcting asset file import

Modified Paths:
--------------
    addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm
    addons/1.3/assets/trunk/sql/modules/Assets-tables.sql
    addons/1.3/base/trunk/sql/modules/Util.sql

Added Paths:
-----------
    addons/1.3/assets/trunk/LedgerSMB/Assets/
    addons/1.3/enhanced_aa/
    addons/1.3/enhanced_aa/tags/
    addons/1.3/enhanced_aa/trunk/
    addons/1.3/enhanced_aa/trunk/UI/
    addons/1.3/enhanced_aa/trunk/UI/aa/
    addons/1.3/enhanced_aa/trunk/UI/aa/transaction.html
    addons/1.3/enhanced_aa/trunk/scripts/
    addons/1.3/enhanced_aa/trunk/scripts/arap2.pl

Modified: addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm
===================================================================
--- addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm	2010-07-30 20:19:09 UTC (rev 3037)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm	2010-08-04 21:23:30 UTC (rev 3038)
@@ -29,8 +29,16 @@
 
     my $self = shift @_;
 
-    my $csv = LedgerSMB::Assets::CSV->new(base=>$self);
-    $self->{import_entries} = $csv->process($self, 'import_file');
+    my $handle = $self->{_request}->upload('import_file');
+    $contents = join("\n", <$handle>);
+
+    $self->{import_entries} = [];
+    while my $line (split /\n/, $contents){
+        next if ($line =~ /^$/);
+        $first = 0;
+        my @fields = split(/,/, $line);
+        push @{$self->{import_entries}}, ..hidden..;
+    }     
     unshift @{$self->{import_entries}}; # get rid of header line
     return @{$self->{import_entries}};
 }

Modified: addons/1.3/assets/trunk/sql/modules/Assets-tables.sql
===================================================================
--- addons/1.3/assets/trunk/sql/modules/Assets-tables.sql	2010-07-30 20:19:09 UTC (rev 3037)
+++ addons/1.3/assets/trunk/sql/modules/Assets-tables.sql	2010-08-04 21:23:30 UTC (rev 3038)
@@ -103,6 +103,8 @@
 
 INSERT INTO asset_report_class (id, class) values (1, 'depreciation');
 INSERT INTO asset_report_class (id, class) values (2, 'disposal');
+INSERT INTO asset_report_class (id, class) values (3, 'import');
+INSERT INTO asset_report_class (id, class) values (4, 'partial disposal');
 
 CREATE TABLE asset_report (
 	id serial primary key,

Modified: addons/1.3/base/trunk/sql/modules/Util.sql
===================================================================
--- addons/1.3/base/trunk/sql/modules/Util.sql	2010-07-30 20:19:09 UTC (rev 3037)
+++ addons/1.3/base/trunk/sql/modules/Util.sql	2010-08-04 21:23:30 UTC (rev 3038)
@@ -137,9 +137,3 @@
 SELECT DISTINCT EXTRACT ('YEAR' FROM transdate)::int
 FROM acc_trans;
 $$ language sql;
-
-CREATE OR REPLACE FUNCTION account__get_by_link_desc(in_description text)
-RETURNS SETOF account AS $$
-SELECT * FROM account
-WHERE id IN (SELECT account_id FROM account_link WHERE description = $1);
-$$ language sql;

Added: addons/1.3/enhanced_aa/trunk/UI/aa/transaction.html
===================================================================
--- addons/1.3/enhanced_aa/trunk/UI/aa/transaction.html	                        (rev 0)
+++ addons/1.3/enhanced_aa/trunk/UI/aa/transaction.html	2010-08-04 21:23:30 UTC (rev 3038)
@@ -0,0 +1,99 @@
+<?lsmb PROCESS 'ui-header.html' ?>
+<?lsmb INCLUDE 'elements.html' ?>
+<body>
+<?lsmb 
+    # Localization strings
+    # text('Edit Debit Note')
+    # text('Add Credit Note')
+    # text('Edit Credit Note')
+    # text('Add AP Transaction')
+    # text('Edit AP Transaction')
+?>
+<form method="POST" action="arap2.pl">
+<?lsmb FOR hid IN hiddens;
+     PROCESS input element_data = {
+             type = "hidden"
+             name = hid
+             value = ${hid}
+     };
+END ?>
+<div class="listtop"><?lsmb title ?></div>
+<table width="100%">
+  <tr valign="top">
+    <td>
+      <table width="100%">
+        <tr valign="top">
+          <td>
+            <table>
+              <tr>
+                <th align="right" nowrap><?lsmb vc_label ?></th>
+                <td colspan="3">
+                <?lsmb IF selectvc;
+                       PROCESS select element_data = {
+                               name = vc
+                               value_attr = 'id'
+                               options = contact_options
+                               default_options = [vc]
+                               class = "credit"
+                       };
+                       ELSE;
+                       PROCESS input element_data = {
+                               name = vc
+                               value = ${vc}
+                               type = "text"
+                               class = "credit"
+                       };
+                       END ?>
+                </td>
+              </tr>
+              <tr>
+                <td></td>
+                <td colspan="3">
+                  <table width="100%">
+                    <tr>
+                      <th align="left">
+                          <?lsmb text('Credit Limit') ?>
+                      </th>
+                      <td><?lsmb creditlimit ?></td>
+                      <th align=left><?lsmb text('Remaining') ?></th>
+                      <td class="plus$n"><?lsmb creditremaining ?></td>
+                    </tr>
+                  </table>
+                </td>
+              </tr>
+                <?lsmb IF batch_id ?>
+              <tr>
+                <th align="right"> 
+                    <? text('Batch Control Code') ?>
+                </th>
+                <td><?lsmb batch_control_code ?></td>
+              </tr>
+                <tr>
+                <th align="right"> <?lsmb text('Batch Name') ?> </th>
+                <td><?lsmb batch_description ?></td>
+              </tr>
+                <?lsmb END ?>
+		<?lsmb IF entity_control_code ?>
+	        <tr>
+		<th align="right"> 
+                    <?lsmb text('Entity Control Code') ?></th>
+		<td colspan=3> <?lsmb entity_control_code ?></td>
+	      </tr>
+	        <tr>
+		<th align="right"> <?lsmb text('Account') ?></th>
+		<td colspan=3><?lsmb meta_number ?></td>
+	      </tr>
+                <?lsmb END ?>
+              <tr>
+                <th align=right nowrap> <?lsmb text('Currency') ?></th>
+                <td><?lsmb PROCESS select element_data = {
+                           name = "currency"
+                           default_values = [currency]
+                           options = currencies
+                           text_attr = "curr"
+                           value_attr = "curr"
+                           class = "currency"
+                } ?></td>
+</form>
+</body>
+</html>

Added: addons/1.3/enhanced_aa/trunk/scripts/arap2.pl
===================================================================
--- addons/1.3/enhanced_aa/trunk/scripts/arap2.pl	                        (rev 0)
+++ addons/1.3/enhanced_aa/trunk/scripts/arap2.pl	2010-08-04 21:23:30 UTC (rev 3038)
@@ -0,0 +1,20 @@
+=pod
+
+=cut
+
+
+
+sub display_screen {
+    my ($request) = @_;
+    @{$request->{hiddens}} = qw(batch_id approved id printed emailed sort 
+           closedto locked title type oldtransdate audittrail recurring 
+           checktax reverse batch_id subtype entity_control_code meta_number
+           defaultcurrency);
+    push @{$request->{hiddens}}, 
+         ("old$form->{vc}",  "$form->{vc}_id",
+        "terms",           "creditlimit",
+        "creditremaining", "selectcurrency",
+        "defaultcurrency", "select$form->{ARAP}_amount",
+        "rowcount");
+
+}


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