- locations_list_row(_("Items Returned to Inventory Location"), 'Location', $_POST['Location']);
- } else { /* the goods are to be written off to somewhere */
- gl_all_accounts_list_row(_("Write Off the Cost of the Items to"), 'WriteOffGLCode', $_POST['WriteOffGLCode']);
- }
- textarea_row(_("Memo"), "CreditText", null, 45, 3);
- end_table();
+ credit_type_list_row(_("Credit Note Type"), 'CreditType', null, true);
+
+ if ($_POST['CreditType'] == "Return")
+ {
+
+ /*if the credit note is a return of goods then need to know which location to receive them into */
+ if (!isset($_POST['Location']))
+ $_POST['Location'] = $_SESSION['Items']->Location;
+ locations_list_row(_("Items Returned to Location"), 'Location', $_POST['Location']);
+ }
+ else
+ {
+ /* the goods are to be written off to somewhere */
+ gl_all_accounts_list_row(_("Write off the cost of the items to"), 'WriteOffGLCode', null);
+ }
+
+ textarea_row(_("Memo"), "CreditText", null, 51, 3);
+ echo "</table>";
+ div_end();