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

SF.net SVN: ledger-smb:[4531] trunk



Revision: 4531
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4531&view=rev
Author:   einhverfr
Date:     2012-03-23 00:09:48 +0000 (Fri, 23 Mar 2012)
Log Message:
-----------
Merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Part.pm
    trunk/LedgerSMB/ScriptLib/Common_Search/Part.pm
    trunk/LedgerSMB/ScriptLib/Common_Search.pm
    trunk/LedgerSMB/ScriptLib/Company.pm
    trunk/UI/lib/dynatable.html
    trunk/lsmb-request.pl

Added Paths:
-----------
    trunk/LedgerSMB/DBObject/Pricelist.pm

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/account.pm
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/customer.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/journal.pm
    trunk/LedgerSMB/Scripts/login.pm
    trunk/LedgerSMB/Scripts/menu.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/recon.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Scripts/taxform.pm
    trunk/LedgerSMB/Scripts/vendor.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4525
   + /branches/1.3:3711-4530

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/Changelog	2012-03-23 00:09:48 UTC (rev 4531)
@@ -49,6 +49,7 @@
 * Corrected warnings for missin glog initalization (Andres B)
 * XAL and ODS buttons are now disabled if prereqs are missing (Erik H)
 * Experimental support for migrating from SQL-Ledger via Setup.pl (Chris T)
+* Fixed POD issues with lsmb-request.pl (h/t Robert C) (Chris T item 3472648)
 
 Andres B is Andres Basile
 

Modified: trunk/LedgerSMB/DBObject/Part.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Part.pm	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/LedgerSMB/DBObject/Part.pm	2012-03-23 00:09:48 UTC (rev 4531)
@@ -61,6 +61,8 @@
     );
 }
 
+=back
+
 =head1 COPYRIGHT
 
 Copyright (C) 2012 The LedgerSMB Core Team.  This file may be re-used under the

Copied: trunk/LedgerSMB/DBObject/Pricelist.pm (from rev 4530, branches/1.3/LedgerSMB/DBObject/Pricelist.pm)
===================================================================
--- trunk/LedgerSMB/DBObject/Pricelist.pm	                        (rev 0)
+++ trunk/LedgerSMB/DBObject/Pricelist.pm	2012-03-23 00:09:48 UTC (rev 4531)
@@ -0,0 +1,70 @@
+=head1 NAME
+
+LedgerSMB::DBObject::Pricelist - Pricelists for customers and vendors
+
+=head1 SYNOPSIS
+
+ my $pl = LedgerSMB::DBObject::Pricelist->new({base => $request});
+ $pl->save(..hidden..);
+
+=cut
+
+package LedgerSMB::DBObject::Pricelist;
+use base qw(LedgerSMB::DBObject);
+use strict;
+use warnings;
+
+=head1 DESCRIPTION
+
+This module contains the pricelist saving routines for 1.3.  In 1.4 more
+pricelist routines will be added.
+
+=head1 PROPERTIES
+
+=over
+
+=item entity_class
+
+This tells us whether this is a customer or vendor's pricelist.
+
+=item credit_id 
+
+tells us who this is for.
+
+=back
+
+=head1 METHODS
+
+=over
+
+=item save(..hidden..);
+
+Saves the pricelist.
+
+=cut
+
+sub save {
+    my ($self, $lines) = @_;
+    $self->exec_method({funcname => 'pricelist__clear'});
+    for my $ref (@$lines){
+        my $line = $self->new({base => $self, 
+                               copy => 'list',  
+                          mergelist => ['entity_class', 'credit_id'], }
+        );
+        $line->merge($ref);
+        $line->exec_method({funcname => 'pricelist__add'});
+    }
+    $dbh->commit;
+}
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012 The LedgerSMB Core Team.  This file may be re-used under the
+terms of the GNU General Public License version 2 or at your option any later
+version.  Please see the included LICENSE.txt for more information.
+
+=cut
+
+return 1;

Modified: trunk/LedgerSMB/ScriptLib/Common_Search/Part.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Common_Search/Part.pm	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/LedgerSMB/ScriptLib/Common_Search/Part.pm	2012-03-23 00:09:48 UTC (rev 4531)
@@ -26,7 +26,7 @@
 my $COLUMNS = [
       {col_id => 'id',
          name => 'ID',
-         type => 'mirrored', }
+         type => 'mirrored', },
 
       {col_id => 'partnumber',
          name => 'Partnumber',
@@ -88,7 +88,7 @@
 
 sub search {
     my ($self, $args) = @_;
-    @results = $self->{_part}->search_lite($args);
+    my @results = $self->{_part}->search_lite($args);
     $self->{_results} = ..hidden..;
     return $self->{_results};
 }

Modified: trunk/LedgerSMB/ScriptLib/Common_Search.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Common_Search.pm	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/LedgerSMB/ScriptLib/Common_Search.pm	2012-03-23 00:09:48 UTC (rev 4531)
@@ -99,6 +99,8 @@
 
 =head2 Child Classes Must Implement the Following
 
+=over
+
 =item columns
 
 Returns a list of columns as expected for Dynatable.

Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/LedgerSMB/ScriptLib/Company.pm	2012-03-23 00:09:48 UTC (rev 4531)
@@ -1048,6 +1048,67 @@
 
 =item delete_price
 
+=item save_pricelist
+
+This routine saves the price matrix.  For existing rows, valid_to, valid_from,
+price fields are saved.
+
+For the new row, the partnumber field matches the beginning of the part number,
+and the description is a full text search.
+
+=cut
+
+sub save_pricelist {
+    my ($request) = @_;
+    use LedgerSMB::ScriptLib::Common_Search::Part;
+
+    my $count = $request->{rowcount};
+    my $pricelist = LedgerSMB::DBObject::Pricelist;
+    my @lines;
+    my $redirect_to_selection = 0;
+
+    # Search and populate
+    my $psearch = LedgerSMB::ScriptLib::Common_Search::Part->new($request);
+    my @parts = $psearch->search(
+                   { partnumber => $request->{"int_partnumber_tfoot_$count"},
+                    description => $request->{"description_tfoot_$count"}, }
+    );
+    if (scalar @parts == 0) {
+        $request->error($request->{_locale}->text('Part not found'));
+    } elsif (scalar @parts > 1){
+        $redirect_to_selection = 1;
+    } else {
+        push @lines, { id => $parts[1]->{id},
+                  validfrom => $request->{"validfrom_tfoot_$count"},
+                    validto => $request->{"validto_tfoot_$count"},
+                   lastcost => $request->{"lastcost_tfoot_$count"},
+                  sellprice => $request->{"sellprice_tfoot_$count"},
+                   leadtime => $request->{"leadtime_tfoot_$count"},
+             }; 
+    }
+
+    # Save rows
+    for (1 .. ($count - 1)){
+        $id = $request->{"row_id_$_"};
+        push @lines, { id => $id,
+               validfrom => $request->{"validfrom_$id"},
+                 validto => $request->{"validto_$id"},
+                lastcost => $request->{"lastcost_$id"},
+               sellprice => $request->{"sellprice_$id"},
+                leadtime => $request->{"leadtime_$id"},
+        };
+    }
+
+    $pricelist->save(..hidden..);
+
+    # Return to UI
+
+    pricelist($request) unless $redirect_to_selection;
+
+    $psearch->render;
+}
+
+
 =back
 
 =head1 COPYRIGHT


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4525
/branches/1.3/scripts/account.pl:3711-4368
   + /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4530
/branches/1.3/scripts/account.pl:3711-4368


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4525
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4530
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4525
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4530
/branches/1.3/scripts/customer.pl:4273-4287


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4525
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4530
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4525
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4530
/branches/1.3/scripts/file.pl:3711-4138


Property changes on: trunk/LedgerSMB/Scripts/journal.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4525
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4530
/branches/1.3/scripts/journal.pl:3711-4328


Property changes on: trunk/LedgerSMB/Scripts/login.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4525
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4530
/branches/1.3/scripts/login.pl:3711-4192


Property changes on: trunk/LedgerSMB/Scripts/menu.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4525
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4530
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4525
/branches/1.3/scripts/payment.pl:3711-4310
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4530
/branches/1.3/scripts/payment.pl:3711-4310


Property changes on: trunk/LedgerSMB/Scripts/recon.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4525
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287,4393-4438
   + /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4530
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287,4393-4438


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4525
/branches/1.3/scripts/setup.pl:3711-4525
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4530
/branches/1.3/scripts/setup.pl:3711-4525


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4525
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4530
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/vendor.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4525
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4530
/branches/1.3/scripts/vendor.pl:4273-4287

Modified: trunk/UI/lib/dynatable.html
===================================================================
--- trunk/UI/lib/dynatable.html	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/UI/lib/dynatable.html	2012-03-23 00:09:48 UTC (rev 4531)
@@ -12,7 +12,7 @@
 </thead>
 <?lsmb- END -?>
 <tbody>
-   <?lsmb- ROWCOUNT = 0;
+   <?lsmb- ROWCOUNT = 1;
    PFX = attributes.input_prefix;
    FOREACH ROW IN tbody.rows;
    ROWCOUNT = ROWCOUNT + 1 -?>

Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl	2012-03-22 11:56:53 UTC (rev 4530)
+++ trunk/lsmb-request.pl	2012-03-23 00:09:48 UTC (rev 4531)
@@ -1,7 +1,7 @@
 =head1 NAME
-#!/usr/bin/perl
-The LedgerSMB Request Handler
 
+lsmb-request.pl - The LedgerSMB Request Handler
+
 =head1 SYNOPSYS
 This file receives the web request, instantiates the proper objects, and passes
 execution off to the appropriate workflow scripts.  This is for use with new 


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4525
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4530
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

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