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

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



Revision: 4719
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4719&view=rev
Author:   einhverfr
Date:     2012-05-18 12:11:18 +0000 (Fri, 18 May 2012)
Log Message:
-----------
merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Template/ODS.pm
    trunk/UI/Contact/pricelist.html

Added Paths:
-----------
    trunk/UI/Contact/pricelist.csv
    trunk/UI/Contact/pricelist.odst
    trunk/UI/lib/dynatable.odst

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-4715
   + /branches/1.3:3711-4718

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-05-18 11:28:28 UTC (rev 4718)
+++ trunk/Changelog	2012-05-18 12:11:18 UTC (rev 4719)
@@ -49,6 +49,10 @@
 Initial Release:  Monday, Oct 12 2011
 Supported Presently
 
+Changelog for 1.3.18
+* Fixed missing template for CSV pricelists (Chris T)
+* Added ODS pricelists (Chris T)
+
 Changelog for 1.3.17
 * Address now shows on ECA selection screen (Erik H)
 * Taxes::Simple now respects min/max values based on subtotal (Chris T)


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4715
/branches/1.3/scripts/account.pl:3711-4368
   + /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4718
/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-4715
/branches/1.3/scripts/admin.pl:3711-4678
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4718
/branches/1.3/scripts/admin.pl:3711-4678


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4715
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4718
/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-4715
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4718
/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-4715
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4718
/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-4715
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4718
/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-4715
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4718
/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-4715
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4718
/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-4715
/branches/1.3/scripts/payment.pl:3711-4680
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4718
/branches/1.3/scripts/payment.pl:3711-4680


Property changes on: trunk/LedgerSMB/Scripts/recon.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4715
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287,4393-4438
   + /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4718
/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-4715
/branches/1.3/scripts/setup.pl:3711-4550
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4718
/branches/1.3/scripts/setup.pl:3711-4550


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4715
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4718
/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-4715
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4718
/branches/1.3/scripts/vendor.pl:4273-4287

Modified: trunk/LedgerSMB/Template/ODS.pm
===================================================================
--- trunk/LedgerSMB/Template/ODS.pm	2012-05-18 11:28:28 UTC (rev 4718)
+++ trunk/LedgerSMB/Template/ODS.pm	2012-05-18 12:11:18 UTC (rev 4719)
@@ -54,7 +54,10 @@
 use XML::Twig;
 use OpenOffice::OODoc;
 use LedgerSMB::Template::TTI18N;
+use LedgerSMB::Sysconfig;
 
+$OpenOffice::OODoc::File::WORKING_DIRECTORY = $LedgerSMB::Sysconfig::tempdir;
+
 my $binmode = undef;
 binmode STDOUT, ':bytes';
 binmode STDERR, ':bytes';
@@ -63,7 +66,11 @@
 my $ods;
 my $rowcount;
 my $currcol;
+my $maxrows;
+my $maxcols;
 my %celltype;
+my $sheetnum = -1;
+my $sheetname;
 
 # SC: The elements of the style table for regular styles and stack are
 #     arrays where the stack name is the first element and the style
@@ -119,16 +126,20 @@
 	);
 
 sub _worksheet_handler {
+        $sheetnum += 1;
 	$rowcount = -1;
 	$currcol = 0;
 	my $rows = $_->{att}->{rows};
 	my $columns = $_->{att}->{columns};
 	$rows ||= 1000;
 	$columns ||= 52;
+        $maxrows = $rows;
+        $maxcols = $columns;
 	my $sheet;
 	if ($_->is_first_child) {
 		$sheet = $ods->getTable(0, $rows, $columns);
 		$ods->renameTable($sheet, $_->{att}->{name});
+                $sheetname = $_->{att}->{name};
 	} else {
 		$sheet = $ods->appendTable($_->{att}->{name}, $rows, $columns);
 	}
@@ -140,7 +151,8 @@
 }
 
 sub _cell_handler {
-	my $cell = $ods->getCell(-1, $rowcount, $currcol);
+        $ods->expandTable($sheetname, $maxrows, $maxcols);
+	my $cell = $ods->getCell($sheetname, $rowcount, $currcol);
 	
 	if (@style_stack and $celltype{$style_stack[0][0]}) {
 		$ods->cellValueType($cell, $celltype{$style_stack[0][0]}[0]);
@@ -152,7 +164,9 @@
 			$ods->cellValueType($cell, 'float');
 		}
 	}
-	$ods->cellValue($cell, $_->{att}->{text});
+        print STDERR "Calling cellValue($sheetname, $rowcount, $currcol, $_->{att}->{text})\n";
+	$ods->cellValue($sheetname, $rowcount, $currcol, $_->{att}->{text});
+        print STDERR "The above cell is now set to " . $ods->getCellValue($sheetnum, $rowcount, $currcol) . "\n";
 	if (@style_stack) {
 		$ods->cellStyle($cell, $style_stack[0][0]);
 	}
@@ -160,7 +174,7 @@
 }
 
 sub _formula_handler {
-	my $cell = $ods->getCell(-1, $rowcount, $currcol);
+	my $cell = $ods->getCell($sheetnum, $rowcount, $currcol);
 	
 	if (@style_stack and $celltype{$style_stack[0][0]}) {
 		$ods->cellValueType($cell, $celltype{$style_stack[0][0]}[0]);
@@ -762,8 +776,7 @@
 
 sub _ods_process {
 	my ($filename, $template) = @_;
-
-	$ods = ooDocument(file => $filename, create => 'spreadsheet');
+	$ods = ooDocument(file => "$filename", create => 'spreadsheet');
 	
 	my $parser = XML::Twig->new(
 		start_tag_handlers => {
@@ -789,6 +802,15 @@
 		);
 	$parser->parse($template);
 	$parser->purge;
+##############
+use Data::Dumper;
+           my $d    = Data::Dumper->new( [$ods] );
+    $d->Sortkeys(1);
+
+        open( FH, '>', "/tmp/ods" ) or die $!;
+        print FH $d->Dump();
+        close(FH);
+########### 
 	$ods->save;
 }
 

Copied: trunk/UI/Contact/pricelist.csv (from rev 4718, branches/1.3/UI/Contact/pricelist.csv)
===================================================================
--- trunk/UI/Contact/pricelist.csv	                        (rev 0)
+++ trunk/UI/Contact/pricelist.csv	2012-05-18 12:11:18 UTC (rev 4719)
@@ -0,0 +1,49 @@
+<?lsmb- PROCESS 'dynatable.csv' -?>
+<?lsmb-
+    columns = [ 
+              { col_id = 'parts_id',
+                  type = 'hidden' },
+              { col_id = 'int_partnumber'
+                  name = text('Partnumber')
+                  type = 'text'
+                },
+                { col_id = 'description'
+                  name = text('Description')
+                  type = 'text'
+                } ];
+     IF account_class == 1;
+         columns.push(
+                  {col_id = 'lastcost'
+                     name = text('Last Cost') 
+                     type = 'text_input'},
+                  {col_id = 'partnumber',
+                     name = text('Vendor Partnumber') 
+                     type = 'text_input'},
+                  {col_id = 'leadtime',
+                     name = text('Lead Time') 
+                     type = 'input_text'}
+         );
+
+     ELSE;
+
+         columns.push(
+                  {col_id = 'sellprice'
+                     name = text('Sell Price') 
+                     type = 'input_text'},
+                  {col_id = 'validfrom',
+                     name = text('Valid From') 
+                     type = 'input_text'},
+                  {col_id = 'validto',
+                     name = text('Valid To') 
+                     type = 'input_text'},
+         );
+                        
+     END;
+     columns.push({col_id = 'currency',
+                     name = text('Currency'),
+                     type = 'text'},
+     );
+      PROCESS dynatable
+         tbody = { rows = pricematrix }
+
+-?>

Modified: trunk/UI/Contact/pricelist.html
===================================================================
--- trunk/UI/Contact/pricelist.html	2012-05-18 11:28:28 UTC (rev 4718)
+++ trunk/UI/Contact/pricelist.html	2012-05-18 12:11:18 UTC (rev 4719)
@@ -91,6 +91,12 @@
 ?> <a href="customer.pl?action=pricelist&format=XLS&credit_id=<?lsmb 
              credit_id ?>&entity_id=<?lsmb entity_id 
      ?>">[<?lsmb text('XLS') ?>]</a>
+<?lsmb END;
+
+IF FORMATS.grep('ODS').size() 
+?> <a href="customer.pl?action=pricelist&format=ODS&credit_id=<?lsmb 
+             credit_id ?>&entity_id=<?lsmb entity_id 
+     ?>">[<?lsmb text('ODS') ?>]</a>
 <?lsmb END ?>
  <a href="customer.pl?action=pricelist&format=CSV&credit_id=<?lsmb 
              credit_id ?>&entity_id=<?lsmb entity_id 

Copied: trunk/UI/Contact/pricelist.odst (from rev 4718, branches/1.3/UI/Contact/pricelist.odst)
===================================================================
--- trunk/UI/Contact/pricelist.odst	                        (rev 0)
+++ trunk/UI/Contact/pricelist.odst	2012-05-18 12:11:18 UTC (rev 4719)
@@ -0,0 +1,54 @@
+<workbook>
+<?lsmb 
+    PROCESS 'dynatable.odst';
+    columns = [ 
+              { col_id = 'parts_id',
+                  type = 'hidden' },
+              { col_id = 'int_partnumber'
+                  name = text('Partnumber')
+                  type = 'text'
+                },
+                { col_id = 'description'
+                  name = text('Description')
+                  type = 'text'
+                } ];
+     IF account_class == 1;
+         columns.push(
+                  {col_id = 'lastcost'
+                     name = text('Last Cost') #'
+                     type = 'text_input'},
+                  {col_id = 'partnumber',
+                     name = text('Vendor Partnumber') #'
+                     type = 'text_input'},
+                  {col_id = 'leadtime',
+                     name = text('Lead Time') #'
+                     type = 'input_text'}
+         );
+     ELSE;
+         columns.push(
+                  {col_id = 'sellprice'
+                     name = text('Sell Price') #'
+                     type = 'input_text'},
+                  {col_id = 'validfrom',
+                     name = text('Valid From') #'
+                     type = 'input_text'},
+                  {col_id = 'validto',
+                     name = text('Valid To') #'
+                     type = 'input_text'},
+         );
+                        
+     END;
+     columns.push({col_id = 'currency',
+                     name = text('Currency'),
+                     type = 'text'}
+     ); 
+    PROCESS dynatable
+         attributes = { id = 'pricematrix' }
+         tbody = { rows = pricematrix };
+    IF pricematrix_pricegroup.size;
+         PROCESS dynatable
+             attributes = { id = 'pricegroup' }
+             tbody = { rows = pricematrix_pricegroup };
+    END;
+?>
+</workbook>

Copied: trunk/UI/lib/dynatable.odst (from rev 4718, branches/1.3/UI/lib/dynatable.odst)
===================================================================
--- trunk/UI/lib/dynatable.odst	                        (rev 0)
+++ trunk/UI/lib/dynatable.odst	2012-05-18 12:11:18 UTC (rev 4719)
@@ -0,0 +1,47 @@
+<?lsmb- BLOCK dynatable;
+
+ROWCOUNT = 1;
+
+IF tbody.rows.size;
+  ROWCOUNT = ROWCOUNT + tbody.rows.size;
+END;
+
+IF tfoot.rows.size;
+  ROWCOUNT = ROWCOUNT + tbody.rows.size;
+END;
+
+-?>
+<worksheet name="<?lsmb attributes.id ?>" rows="<?lsmb ROWCOUNT ?>" columns="<?lsmb columns.size + 1 ?>">
+<format bottom="5" bg_color="lime" bottom_color="magenta">
+<?lsmb IF !hide_header -?>
+   <row>
+   <?lsmb FOREACH COL IN columns; 
+   IF COL.type != 'hidden'; -?>
+   <cell text="<?lsmb COL.name ?>" />
+   <?lsmb END; END; ?>
+   </row>
+<?lsmb END -?>
+</format>
+<format align="right">
+<?lsmb FOREACH ROW IN tbody.rows -?>
+   <row>
+      <?lsmb FOREACH COL IN columns -?>
+       <?lsmb IF COL.type != 'hidden'; -?>
+        <cell text="<?lsmb ROW.${COL.col_id} ?>" />
+      <?lsmb END; END -?>
+	</row>
+	<?lsmb END -?>
+<?lsmb- IF tfoot -?>
+   <?lsmb- FOREACH ROW IN tfoot.rows; ?>
+	<row>
+	<?lsmb FOREACH COL IN columns ?>
+        <?lsmb IF COL.type != 'hidden'; -?>
+		<cell text="<?lsmb ROW.${COL.col_id} ?>" />
+      
+	<?lsmb END; END ?>
+	</row>
+        <?lsmb END;
+END ?>
+</format>
+</worksheet>
+<?lsmb END ?>


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-4715
/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-4718
/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.