break;
case 'list':
// Get list of pending invoices ( not overdue )
- $pendingWhere = 'T.paid <> true AND due_date > NOW()';
+ $pendingWhere = 'T.paid <> true AND T.due_date > now()';
$start = 1;
$pending = $this->getList( $pendingWhere, 'transaction_time', true, 'id', $start, $limit );
/**
$numberPending = ( isset( $pending['returned'] ) ? $pending['returned'] : 0 );
// Get the number of over due invoices
- $overDueWhere = 'T.paid <> true AND due_date > NOW()';
+ $overDueWhere = 'T.paid <> true AND T.due_date < now()';
$start = 1;
$overdue = $this->getList( $overDueWhere, 'transaction_time', true, 'id', $start, $limit );
- $numberOverDue = $overdue['returned'];
+ $numberOverdue = $overdue['returned'];
break;
}
$_REQUEST['due_date'] = date('Y-m-d', strtotime($_REQUEST['due_date']));
// echo '<pre>' . print_r( $_REQUEST, true ) . '</pre>';
$invoices = $this->insertEntry();
+
+ // TODO: Need to check to see if we received a good response
+ // For adding the new Invoice.
$this->invoice_id = $invoices['fieldData']['id'];
// After the Invoice is created need to add each line item
if ( isset( $_REQUEST['line_items'] ) ) {
return valid;
}
+ /**
+ * Add a single line item to the invoice page
+ */
function addLineItemToInvoice( lineItem )
{
lineItem.qty = parseInt(1);
invoiceTypeJSON = data;
// console.log( 'invoiceTypeJSON', invoiceTypeJSON );
addLineItemToInvoice( invoiceTypeJSON[lineItemId] );
+ totalInvoice();
});
}
<th>Member Name</th>
<th>Time</th>
<th>Due Date</th>
+ <th>Amount Total</th>
<th>Balance</th>
<th>View</th>
</tr>
<td> {$t.member_name} </td>
<td> {$t.transaction_time.datetime} </td>
<td> {$t.due_date.date} </td>
+ <td> {$t.amount_total} </td>
<td> {$t.balance} </td>
<td> <a href="{$thisUrl}?page={$thisPage}&glm_action=invoices&option=view&id={$t.id}">View</a> </td>
</tr>