mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix next number issue on estimate & invoice
This commit is contained in:
@ -77,7 +77,7 @@ class Estimate extends Model implements HasMedia
|
|||||||
{
|
{
|
||||||
// Get the last created order
|
// Get the last created order
|
||||||
$lastOrder = Estimate::where('estimate_number', 'LIKE', $value . '-%')
|
$lastOrder = Estimate::where('estimate_number', 'LIKE', $value . '-%')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('estimate_number', 'desc')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (!$lastOrder) {
|
if (!$lastOrder) {
|
||||||
@ -435,7 +435,7 @@ class Estimate extends Model implements HasMedia
|
|||||||
|
|
||||||
if ($logo && $isLocalhost && $isSystem) {
|
if ($logo && $isLocalhost && $isSystem) {
|
||||||
$logo = $logo->getPath();
|
$logo = $logo->getPath();
|
||||||
} else if($logo) {
|
} else if ($logo) {
|
||||||
$logo = $logo->getFullUrl();
|
$logo = $logo->getFullUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class Invoice extends Model implements HasMedia
|
|||||||
{
|
{
|
||||||
// Get the last created order
|
// Get the last created order
|
||||||
$lastOrder = Invoice::where('invoice_number', 'LIKE', $value . '-%')
|
$lastOrder = Invoice::where('invoice_number', 'LIKE', $value . '-%')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('invoice_number', 'desc')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ class Invoice extends Model implements HasMedia
|
|||||||
|
|
||||||
if ($logo && $isLocalhost && $isSystem) {
|
if ($logo && $isLocalhost && $isSystem) {
|
||||||
$logo = $logo->getPath();
|
$logo = $logo->getPath();
|
||||||
} else if($logo) {
|
} else if ($logo) {
|
||||||
$logo = $logo->getFullUrl();
|
$logo = $logo->getFullUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user