- $doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date);
- $doc->pos = user_pos();
- $pos = get_sales_point($doc->pos);
- $doc->cash = $pos['cash_sale'];
- if (!$pos['cash_sale'] || !$pos['credit_sale'])
- $doc->pos = -1; // mark not editable payment type
- else
- $doc->cash = date_diff2($doc->due_date, Today(), 'd')<2;
+ $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date);
+ $doc->pos = get_sales_point(user_pos());