- if (!isset($_POST['WriteOffGLCode']))
- $_POST['WriteOffGLCode'] = "";
- if (!isset($_POST['ShipperID']))
- $_POST['ShipperID'] = 0;
- $credit_no = add_credit_note($_SESSION['credit_items'], $_POST['OrderDate'],
- $_POST['CreditType'], $_POST['tax_group_id'],
- $_POST['ChargeFreightCost'], $_POST['sales_type_id'], $_POST['ShipperID'],
- $_POST['ref'], $_POST['CreditText'], $_POST['WriteOffGLCode']);
-
- unset($_SESSION['credit_items']->line_items);
- unset($_SESSION['credit_items']);
-
+ if (!isset($_POST['WriteOffGLCode'])) {
+ $_POST['WriteOffGLCode'] = 0;
+ }
+ $credit_no = $_SESSION['Items']->write($_POST['WriteOffGLCode']);
+ processing_end();