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

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



Revision: 5432
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5432&view=rev
Author:   einhverfr
Date:     2012-12-27 14:28:02 +0000 (Thu, 27 Dec 2012)
Log Message:
-----------
fixing order shipping
fixing order generation menu and order shipping menu
Fixing security issue (1.4 only) of form->error not terminating on error.

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/OE.pm
    trunk/LedgerSMB/Scripts/order.pm
    trunk/bin/io.pl
    trunk/sql/Pg-database.sql
    trunk/sql/modules/menu_rebuild.sql

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/LedgerSMB/Form.pm	2012-12-27 14:28:02 UTC (rev 5432)
@@ -482,6 +482,7 @@
         }
         die "Error: $msg\n";
     }
+    die;
 }
 
 =item $form->finalize_request();

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/LedgerSMB/OE.pm	2012-12-27 14:28:02 UTC (rev 5432)
@@ -629,10 +629,10 @@
 				o.notes, o.intnotes, o.curr AS currency, 
 				pe.first_name \|\| ' ' \|\| pe.last_name AS employee,
 				o.person_id AS employee_id,
-				o.entity_credit_account AS $form->{vc}_id, c.legal_name AS $form->{vc}, 
+				o.entity_credit_account, c.legal_name, 
 				o.amount AS invtotal, o.closed, o.reqdate, 
 				o.quonumber, o.language_code,
-				o.ponumber
+				o.ponumber, cr.entity_class
 			FROM oe o
 			JOIN entity_credit_account cr ON (cr.id = o.entity_credit_account)
 			JOIN company c ON (cr.entity_id = c.entity_id)
@@ -645,6 +645,13 @@
         $sth->execute( $form->{id} ) || $form->dberror($query);
 
         $ref = $sth->fetchrow_hashref('NAME_lc');
+        if ($ref->{entity_class} == 2){
+           $form->{vc} = 'customer';
+        } elsif ($ref->{entity_class} == 1){
+           $form->{vc} = 'vendor';
+        }
+        $form->{$form->{vc}} = $ref->{legal_name};
+        $form->{"$form->{vc}_id"} = $ref->{entity_credit_account};
         $form->db_parse_numeric(sth=>$sth, hashref=>$ref);
         for ( keys %$ref ) { $form->{$_} = $ref->{$_} }
         $sth->finish;

Modified: trunk/LedgerSMB/Scripts/order.pm
===================================================================
--- trunk/LedgerSMB/Scripts/order.pm	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/LedgerSMB/Scripts/order.pm	2012-12-27 14:28:02 UTC (rev 5432)
@@ -89,11 +89,17 @@
 sub search {
     my $request = shift @_;
     if ($request->{search_type} ne 'search'){
-       $request->{selectable} = 1;
        $request->{open} =1;
-       $request->{col_select} = 1;
        delete $request->{closed};
     }
+    if (($request->{search_type} eq 'combine') or
+        ($request->{search_type} eq 'generate')
+    ){
+       $request->{selectable} = 1;
+       $request->{col_select} = 1;
+    } elsif ($request->{search_type} eq 'ship'){
+       $request->{href_action}='ship_receive';
+    }
     my $report = LedgerSMB::Report::Orders->new(%$request);
     if ($request->{search_type} eq 'combine'){
         $report->buttons([{

Modified: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/bin/io.pl	2012-12-27 14:28:02 UTC (rev 5432)
@@ -39,7 +39,7 @@
 #######################################################################
 
 package lsmb_legacy;
-use Error qw(:try);
+use Try::Tiny;
 use LedgerSMB::Tax;
 use LedgerSMB::Template;
 use LedgerSMB::Sysconfig;
@@ -1932,9 +1932,8 @@
     try {
         $template->render($form);
     }
-    catch Error::Simple with {
-        my $E = shift;
-        $form->error( $E->stacktrace );
+    catch {
+        $form->error( $_ );
     };
 
     # if we got back here restore the previous form

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/sql/Pg-database.sql	2012-12-27 14:28:02 UTC (rev 5432)
@@ -2663,7 +2663,6 @@
 57	Sales Orders	56	1
 58	Purchase Orders	56	2
 56	Generate	50	4
-60	Consolidate	50	5
 61	Sales Orders	60	1
 62	Purchase Orders	60	2
 64	Ship	63	1
@@ -2780,6 +2779,7 @@
 204	Reverse Receipts	200	4
 111	Trial Balance	109	1
 112	Income Statement	109	2
+60	Combine	50	5
 201	Payments	200	1
 202	Reverse Payment	200	2
 210	Drafts	205	2
@@ -2962,18 +2962,8 @@
 52	type	purchase_order	125
 53	menu	1	126
 56	menu	1	133
-57	module	oe.pl	134
-57	action	search	136
-58	module	oe.pl	137
-58	action	search	139
-57	type	generate_sales_order	135
-58	type	generate_purchase_order	138
 60	menu	1	550
 63	menu	1	146
-64	module	oe.pl	147
-64	action	search	148
-65	module	oe.pl	150
-65	action	search	151
 66	module	oe.pl	153
 66	action	search_transfer	154
 67	menu	1	155
@@ -2985,7 +2975,6 @@
 69	type	request_quotation	161
 70	menu	1	162
 7	module	reports.pl	15
-64	type	ship_order	149
 7	action	start_report	16
 7	report_name	aging	17
 27	module	reports.pl	63
@@ -3049,12 +3038,23 @@
 55	search_type	search	132
 71	search_type	search	165
 72	search_type	search	167
+57	action	get_criteria	136
+58	action	get_criteria	139
 61	action	get_criteria	141
 62	action	get_criteria	144
 62	search_type	combine	145
 61	search_type	combine	142
 61	module	order.pl	140
 62	module	order.pl	143
+57	module	order.pl	134
+58	module	order.pl	137
+57	search_type	generate	135
+58	search_type	generate	138
+64	action	get_criteria	148
+65	action	get_criteria	151
+64	search_type	ship	149
+64	module	order.pl	147
+65	module	order.pl	150
 84	action	stock_assembly	203
 85	menu	1	204
 86	module	ic.pl	205
@@ -3485,7 +3485,6 @@
 5	entity_class	2	12
 25	entity_class	1	13
 210	module	reports.pl	586
-65	type	receive_order	34
 49	module_name	gl	115
 49	entity_class	3	43
 206	module_name	gl	14
@@ -3499,6 +3498,7 @@
 111	module_name	gl	40
 210	search_type	drafts	46
 112	module_name	gl	79
+65	search_type	ship	34
 9	module	invoice.pl	21
 9	action	start_report	22
 9	entity_class	2	24
@@ -3513,8 +3513,13 @@
 72	oe_class_id	4	70
 61	oe_class_id	1	38
 62	oe_class_id	2	41
+57	oe_class_id	2	42
+58	oe_class_id	1	47
+64	oe_class_id	1	48
+65	oe_class_id	2	49
 \.
 
+
 --
 
 CREATE TABLE menu_acl (

Modified: trunk/sql/modules/menu_rebuild.sql
===================================================================
--- trunk/sql/modules/menu_rebuild.sql	2012-12-27 13:26:02 UTC (rev 5431)
+++ trunk/sql/modules/menu_rebuild.sql	2012-12-27 14:28:02 UTC (rev 5432)
@@ -80,13 +80,6 @@
 
 
 --
--- Name: menu_attribute_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
---
-
-SELECT pg_catalog.setval('menu_attribute_id_seq', 681, true);
-
-
---
 -- Name: menu_node; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
 --
 
@@ -129,13 +122,6 @@
 
 
 --
--- Name: menu_node_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
---
-
-SELECT pg_catalog.setval('menu_node_id_seq', 253, true);
-
-
---
 -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
 --
 
@@ -204,18 +190,8 @@
 52	type	purchase_order	125
 53	menu	1	126
 56	menu	1	133
-57	module	oe.pl	134
-57	action	search	136
-58	module	oe.pl	137
-58	action	search	139
-57	type	generate_sales_order	135
-58	type	generate_purchase_order	138
 60	menu	1	550
 63	menu	1	146
-64	module	oe.pl	147
-64	action	search	148
-65	module	oe.pl	150
-65	action	search	151
 66	module	oe.pl	153
 66	action	search_transfer	154
 67	menu	1	155
@@ -227,7 +203,6 @@
 69	type	request_quotation	161
 70	menu	1	162
 7	module	reports.pl	15
-64	type	ship_order	149
 7	action	start_report	16
 7	report_name	aging	17
 27	module	reports.pl	63
@@ -291,12 +266,23 @@
 55	search_type	search	132
 71	search_type	search	165
 72	search_type	search	167
+57	action	get_criteria	136
+58	action	get_criteria	139
 61	action	get_criteria	141
 62	action	get_criteria	144
 62	search_type	combine	145
 61	search_type	combine	142
 61	module	order.pl	140
 62	module	order.pl	143
+57	module	order.pl	134
+58	module	order.pl	137
+57	search_type	generate	135
+58	search_type	generate	138
+64	action	get_criteria	148
+65	action	get_criteria	151
+64	search_type	ship	149
+64	module	order.pl	147
+65	module	order.pl	150
 84	action	stock_assembly	203
 85	menu	1	204
 86	module	ic.pl	205
@@ -727,7 +713,6 @@
 5	entity_class	2	12
 25	entity_class	1	13
 210	module	reports.pl	586
-65	type	receive_order	34
 49	module_name	gl	115
 49	entity_class	3	43
 206	module_name	gl	14
@@ -741,6 +726,7 @@
 111	module_name	gl	40
 210	search_type	drafts	46
 112	module_name	gl	79
+65	search_type	ship	34
 9	module	invoice.pl	21
 9	action	start_report	22
 9	entity_class	2	24
@@ -755,10 +741,21 @@
 72	oe_class_id	4	70
 61	oe_class_id	1	38
 62	oe_class_id	2	41
+57	oe_class_id	2	42
+58	oe_class_id	1	47
+64	oe_class_id	1	48
+65	oe_class_id	2	49
 \.
 
 
 --
+-- Name: menu_attribute_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('menu_attribute_id_seq', 681, true);
+
+
+--
 -- Data for Name: menu_node; Type: TABLE DATA; Schema: public; Owner: postgres
 --
 
@@ -797,7 +794,6 @@
 57	Sales Orders	56	1
 58	Purchase Orders	56	2
 56	Generate	50	4
-60	Consolidate	50	5
 61	Sales Orders	60	1
 62	Purchase Orders	60	2
 64	Ship	63	1
@@ -914,6 +910,7 @@
 204	Reverse Receipts	200	4
 111	Trial Balance	109	1
 112	Income Statement	109	2
+60	Combine	50	5
 201	Payments	200	1
 202	Reverse Payment	200	2
 210	Drafts	205	2
@@ -988,6 +985,13 @@
 
 
 --
+-- Name: menu_node_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('menu_node_id_seq', 253, true);
+
+
+--
 -- Name: menu_attribute_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
 --
 

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