Ledger going out of balance

Hello,
I am noting certain clients are showing as out of balance in the ledger. I haven’t really paid much attention to the ledger until recently, and it seems like some clients balance out to $0.00, and others show a random number. I have attached a output of one client, but there are several like this.


I am self-hosted on v5.7.7-M123
Thanks.

Hi,

Do you see any errors if you run php artisan ninja:check-data

Hi,

Yes actually. This is the output:

2023-09-05 05:52:22 2023-09-05 05:52:22 Running CheckData... on Connected to Default DB Fix Status = Just checking issues 
2023-09-05 05:52:22 0 clients with incorrect balances
2023-09-05 05:52:22 0 clients with incorrect paid to dates
2023-09-05 05:52:22 0 contacts without a contact_key
2023-09-05 05:52:22 0 clients without any contacts
2023-09-05 05:52:22 0 contacts without a contact_key
2023-09-05 05:52:22 0 vendors without any contacts
2023-09-05 05:52:22 754 activities records with incorrect invoice company id
2023-09-05 05:52:22 1359 activities records with incorrect client company id
2023-09-05 05:52:22 143 activities records with incorrect client_contact company id
2023-09-05 05:52:22 181 activities records with incorrect payment company id
2023-09-05 05:52:22 64 activities records with incorrect recurring_invoice company id
2023-09-05 05:52:22 66 invoices records with incorrect client company id
2023-09-05 05:52:22 53 payments records with incorrect client company id
2023-09-05 05:52:22 0 wrong invoices with bad balance state
2023-09-05 05:52:22 0 Contacts with Send Email = true but no email address
2023-09-05 05:52:22 0 users with duplicate oauth ids
2023-09-05 05:52:22 Done: FAILURE
2023-09-05 05:52:22 Total execution time in seconds: 0.15844297409058

Anything I can do to clean up these entries?

I believe these errors are separate, they are false alerts which will be corrected in the next release.

It looks like the sorting is off for the list of activities above, we’ll make sure it’s corrected.

@david may have some ideas on the why the balance is off.

@cmcam

I see the issue with the check data scripts which will be resolved in 5.7.8

once the flutter app has also updated and the sorting of the ledger has completed, it would be good to recheck the data at that point.

@david
Yep, that fixed the data check output

2023-09-06 12:16:27 2023-09-06 12:16:27 Running CheckData... on Connected to Default DB Fix Status = Just checking issues 
2023-09-06 12:16:27 0 clients with incorrect balances
2023-09-06 12:16:27 0 clients with incorrect paid to dates
2023-09-06 12:16:27 0 contacts without a contact_key
2023-09-06 12:16:27 0 clients without any contacts
2023-09-06 12:16:27 0 contacts without a contact_key
2023-09-06 12:16:27 0 vendors without any contacts
2023-09-06 12:16:27 0 wrong invoices with bad balance state
2023-09-06 12:16:27 0 Contacts with Send Email = true but no email address
2023-09-06 12:16:27 0 users with duplicate oauth ids
2023-09-06 12:16:27 Done: SUCCESS
2023-09-06 12:16:27 Total execution time in seconds: 0.12140989303589

I did get the following in the logs after viewing another client ledger:

[2023-09-06 00:13:03] production.ERROR: Class "Carbon\AbstractTranslator" not found {"exception":"[object] (Error(code: 0): Class \"Carbon\\AbstractTranslator\">
[stacktrace]
#0 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Translator.php(27): require()
#1 /var/www/invoiceninja/vendor/composer/ClassLoader.php(576): include('...')
#2 /var/www/invoiceninja/vendor/composer/ClassLoader.php(427): Composer\\Autoload\\{closure}()
#3 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php(701): Composer\\Autoload\\ClassLoader->loadClass()
#4 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php(738): Carbon\\Carbon::translator()
#5 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php(492): Carbon\\Carbon::getLocaleAwareTranslator()
#6 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php(69): Carbon\\Carbon::setLocale()
#7 /var/www/invoiceninja/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php(45): Carbon\\Laravel\\ServiceProvider->updateLocale()
#8 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Carbon\\Laravel\\ServiceProvider->boot()
#9 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#10 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#11 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#12 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call()
#13 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1010): Illuminate\\Container\\Container->call()
#14 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(991): Illuminate\\Foundation\\Application->bootProvider()
#15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}()
#16 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(990): array_walk()
#17 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#18 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(261): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap()
#19 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(447): Illuminate\\Foundation\\Application->bootstrapWith()
#20 /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(199): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#21 /var/www/invoiceninja/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#22 {main}
"}