#===================================================================== # SQL-Ledger Order Leaves # Copyright (c) 2007 Think Electric # Free software Licensed under the GPL # Author: Cedric Shock # Email: info@think-electric.com # Web: http://www.think-electric.com # #====================================================================== # # Show the leaves (fundamental parts) of an order (in sql-ledger) # # Depends on Perl module Rose-DB-Object #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #Sample code to add to oe.pl: # Order Leaves # #====================================================================== use SL::DB::Part; use SL::DB::Order; use SL::DB::OrderItem; 1; sub totalize { $form->{title} = $locale->text('Totals of stuff'); $form->{orphaned} = 1; # What is this callback business?! $form->{callback} = "$form->{script}?action=totalize&login=$form->{login}&path=$form->{path}" unless $form->{callback}; &display_form; } sub display_form { $form->header; my $ids = $form->{id}; # hask table storing ammontsof each type of thing by their id in the parts table my $table = (); foreach my $id (split(',', $ids )) { my $order = SL::DB::Order->new (id => $id); $order->load; $table = total_order($table, $order); } # We should print a summary of what the order is here... # We really need a decent template system... # Print out a simple report #
Part Number | Description | Qty | Unit | |
---|---|---|---|---|
"; #print $key; #print " | "; print $part->partnumber; print " | "; print $part->description; print " | "; print $value; print " | "; print $part->unit; print " |