:</span> <?php echo wpminv_get_invoice_reference(); ?> </p> <p class="invoicedate"><span class="wpminv-label"><?php _e('Invoice Date', 'simvoicing'); ?> :</span> <?php the_time('d-m-Y'); ?> </p> <p class="invoiceduedate"><span class="wpminv-label"><?php _e('Invoice Due Date', 'simvoicing'); ?> :</span> <?php echo wpminv_get_payment_due_date(); ?> </p> <p class="invoicestatus"><span class="wpminv-label"><?php _e('Status', 'simvoicing'); ?> :</span> <?php echo wpminv_get_invoice_status(); ?> </p> </div> <?php } // end if we have an associated client id
/** * @param int $invoice_id is the id of the invoice to return the class for * @return mixed string if the invoice status returns correctly or false if the invoice doesn't exist * */ function wpminv_get_invoice_status_class($invoice_id = 0) { global $post; /* if not invoice post id provided - use current */ if ($invoice_id == 0) { $invoice_id = $post->ID; } /* store class string output here */ $classes = array(); /* get the status of the current invoice */ $status = wpminv_get_invoice_status($invoice_id); /* add the status class */ $classes[] = strtolower($status); /* get the payment due date of the current invoice */ $payment_due = strtotime(wpminv_get_payment_due_date()); /* get todays date */ $today = strtotime(date('d-m-Y')); /* is the invoice overdue */ if ($payment_due < $today && $status == 'Unpaid') { /* add overdue class */ $classes[] = 'overdue'; } /* implode classes array into a string with spaces */ $classes = implode(' ', $classes); return apply_filters('wpminv_get_invoice_status_class', $classes, $invoice_id); }