[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5829] trunk
- Subject: SF.net SVN: ledger-smb:[5829] trunk
- From: ..hidden..
- Date: Sun, 19 May 2013 02:47:43 +0000
Revision: 5829
http://sourceforge.net/p/ledger-smb/code/5829
Author: einhverfr
Date: 2013-05-19 02:47:43 +0000 (Sun, 19 May 2013)
Log Message:
-----------
Fixing bug 830, cannot delete pending invoices
Modified Paths:
--------------
trunk/LedgerSMB/Report/Unapproved/Drafts.pm
trunk/sql/modules/COGS.sql
trunk/sql/modules/Drafts.sql
Modified: trunk/LedgerSMB/Report/Unapproved/Drafts.pm
===================================================================
--- trunk/LedgerSMB/Report/Unapproved/Drafts.pm 2013-05-19 02:22:10 UTC (rev 5828)
+++ trunk/LedgerSMB/Report/Unapproved/Drafts.pm 2013-05-19 02:47:43 UTC (rev 5829)
@@ -204,7 +204,7 @@
{name => 'action',
type => 'submit',
text => LedgerSMB::Report::text('Delete'),
- value => 'approve',
+ value => 'delete',
class => 'submit', },
];
}
Modified: trunk/sql/modules/COGS.sql
===================================================================
--- trunk/sql/modules/COGS.sql 2013-05-19 02:22:10 UTC (rev 5828)
+++ trunk/sql/modules/COGS.sql 2013-05-19 02:47:43 UTC (rev 5829)
@@ -52,8 +52,6 @@
END IF;
END LOOP;
-RAISE EXCEPTION 'TOO FEW TO REVERSE';
-
END;
$$ LANGUAGE PLPGSQL;
@@ -275,6 +273,10 @@
SELECT * INTO t_part FROM parts WHERE id = t_inv.parts_id;
SELECT * INTO t_ar FROM ar WHERE id = t_inv.trans_id;
+IF t_part.inventory_accno_id IS NULL THEN
+ RETURN 0;
+END IF;
+
IF t_inv.qty + t_inv.allocated = 0 THEN
return 0;
END IF;
Modified: trunk/sql/modules/Drafts.sql
===================================================================
--- trunk/sql/modules/Drafts.sql 2013-05-19 02:22:10 UTC (rev 5828)
+++ trunk/sql/modules/Drafts.sql 2013-05-19 02:47:43 UTC (rev 5829)
@@ -134,7 +134,7 @@
END;
$$ LANGUAGE PLPGSQL SECURITY DEFINER;
-COMMENT ON FUNCTION draft_approve(in_id int) is
+COMMENT ON FUNCTION draft_delete(in_id int) is
$$ Deletes the draft from the book. Only will delete unapproved transactions.
Otherwise an exception is raised and the transaction terminated.$$;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.