示例#1
0
        }
        switch ($this->frequency_id) {
            case FREQUENCY_WEEKLY:
                return $daysSinceLastSent >= 7;
            case FREQUENCY_TWO_WEEKS:
                return $daysSinceLastSent >= 14;
            case FREQUENCY_FOUR_WEEKS:
                return $daysSinceLastSent >= 28;
            case FREQUENCY_MONTHLY:
                return $monthsSinceLastSent >= 1;
            case FREQUENCY_THREE_MONTHS:
                return $monthsSinceLastSent >= 3;
            case FREQUENCY_SIX_MONTHS:
                return $monthsSinceLastSent >= 6;
            case FREQUENCY_ANNUALLY:
                return $monthsSinceLastSent >= 12;
            default:
                return false;
        }
        return false;
    }
}
Invoice::created(function ($invoice) {
    Activity::createInvoice($invoice);
});
Invoice::updating(function ($invoice) {
    Activity::updateInvoice($invoice);
});
Invoice::deleting(function ($invoice) {
    Activity::archiveInvoice($invoice);
});
示例#2
0
                return $daysSinceLastSent >= 14;
            case FREQUENCY_FOUR_WEEKS:
                return $daysSinceLastSent >= 28;
            case FREQUENCY_MONTHLY:
                return $monthsSinceLastSent >= 1;
            case FREQUENCY_THREE_MONTHS:
                return $monthsSinceLastSent >= 3;
            case FREQUENCY_SIX_MONTHS:
                return $monthsSinceLastSent >= 6;
            case FREQUENCY_ANNUALLY:
                return $monthsSinceLastSent >= 12;
            default:
                return false;
        }
        return false;
    }
}
Invoice::created(function ($invoice) {
    if (!$invoice->is_recurring) {
        $invoice->branch->incrementCounter($invoice->is_quote);
        $invoice->account->incrementCounter($invoice->is_quote);
    }
    Activity::createInvoice($invoice);
    BookSale::createBook($invoice);
});
Invoice::updating(function ($invoice) {
    Activity::updateInvoice($invoice);
});
Invoice::deleting(function ($invoice) {
    Activity::archiveInvoice($invoice);
});
示例#3
0
        switch ($this->frequency_id) {
            case FREQUENCY_WEEKLY:
                return $daysSinceLastSent >= 7;
            case FREQUENCY_TWO_WEEKS:
                return $daysSinceLastSent >= 14;
            case FREQUENCY_FOUR_WEEKS:
                return $daysSinceLastSent >= 28;
            case FREQUENCY_MONTHLY:
                return $monthsSinceLastSent >= 1;
            case FREQUENCY_THREE_MONTHS:
                return $monthsSinceLastSent >= 3;
            case FREQUENCY_SIX_MONTHS:
                return $monthsSinceLastSent >= 6;
            case FREQUENCY_ANNUALLY:
                return $monthsSinceLastSent >= 12;
            default:
                return false;
        }
        return false;
    }
}
Invoice::created(function ($invoice) {
    $invoice->branch->incrementCounter($invoice->is_quote);
    Activity::createInvoice($invoice);
});
Invoice::updating(function ($invoice) {
    Activity::updateInvoice($invoice);
});
Invoice::deleting(function ($invoice) {
    Activity::archiveInvoice($invoice);
});