fixed #259
This commit is contained in:
		@@ -73,7 +73,7 @@ class BillReminder extends Command
 | 
			
		||||
        $date = Date::today()->addDays($day)->toDateString();
 | 
			
		||||
 | 
			
		||||
        // Get upcoming bills
 | 
			
		||||
        $bills = Bill::with('vendor')->accrued()->due($date)->get();
 | 
			
		||||
        $bills = Bill::with('vendor')->accrued()->notPaid()->due($date)->get();
 | 
			
		||||
 | 
			
		||||
        foreach ($bills as $bill) {
 | 
			
		||||
            // Notify all users assigned to this company
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ class InvoiceReminder extends Command
 | 
			
		||||
        $date = Date::today()->subDays($day)->toDateString();
 | 
			
		||||
 | 
			
		||||
        // Get upcoming bills
 | 
			
		||||
        $invoices = Invoice::with('customer')->accrued()->due($date)->get();
 | 
			
		||||
        $invoices = Invoice::with('customer')->accrued()->notPaid()->due($date)->get();
 | 
			
		||||
 | 
			
		||||
        foreach ($invoices as $invoice) {
 | 
			
		||||
            // Notify the customer
 | 
			
		||||
 
 | 
			
		||||
@@ -103,6 +103,16 @@ class Bill extends Model
 | 
			
		||||
        return $query->where('bill_status_code', '<>', 'draft');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function scopePaid($query)
 | 
			
		||||
    {
 | 
			
		||||
        return $query->where('bill_status_code', '=', 'paid');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function scopeNotPaid($query)
 | 
			
		||||
    {
 | 
			
		||||
        return $query->where('bill_status_code', '<>', 'paid');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function onCloning($src, $child = null)
 | 
			
		||||
    {
 | 
			
		||||
        $this->bill_status_code = 'draft';
 | 
			
		||||
 
 | 
			
		||||
@@ -111,6 +111,16 @@ class Invoice extends Model
 | 
			
		||||
        return $query->where('invoice_status_code', '<>', 'draft');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function scopePaid($query)
 | 
			
		||||
    {
 | 
			
		||||
        return $query->where('invoice_status_code', '=', 'paid');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function scopeNotPaid($query)
 | 
			
		||||
    {
 | 
			
		||||
        return $query->where('invoice_status_code', '<>', 'paid');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function onCloning($src, $child = null)
 | 
			
		||||
    {
 | 
			
		||||
        $this->invoice_status_code = 'draft';
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user