Crud: [Improvement] Getting sum of particular columns

Created on 5 Jun 2018  路  7Comments  路  Source: Laravel-Backpack/CRUD

Hi guys. First of all - thanks for a great admin panel package! It's awesome!

I would like to propose one improvement - getting sum of particular columns. So, if type of the column is number (or float) - add functionality to get sum of all records by this column under list of results.

I think this improvement would be useful for everyone who working on accounting (or bills, payments, etc.).

triage

Most helpful comment

Hi there, i feel like this is a rather niche usecase and i鈥檓 not 100% sure how it could be implemented by default with datatables sum plugin.

Because we use datatables you can create a custom list.blade.php file and add im thr datatables sum plugin for the time being if you need to have the total:

https://datatables.net/plug-ins/api/sum()

All 7 comments

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps _a lot_ in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (_How do I do X_) - Gitter Chatroom;
  • Long questions (_I have done X and Y and it won't do Z wtf_) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome _awesome_ community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

Hi there, i feel like this is a rather niche usecase and i鈥檓 not 100% sure how it could be implemented by default with datatables sum plugin.

Because we use datatables you can create a custom list.blade.php file and add im thr datatables sum plugin for the time being if you need to have the total:

https://datatables.net/plug-ins/api/sum()

Will close this issue for now - I totally agree with @AbbyJanke . But if people come here and reply that they would also like it (feature request is no longer niche), we should consider building an easier way to do this.

and here's a code snippet you can add to custom list.blade.php for displaying a total in a div you can position wherever you like
https://gist.github.com/breizhwave/545a361ed941d7b449e7a9a07bf97055

Nice! Thanks for sharing this @breizhwave !

need this feature. its very helpful on accounting side! hehe

Hey @charliedearce

Have you checked: backpack widgets

You can add nice widgets with your sums and accounting stats.

Best,
Pedro

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abewartech picture abewartech  路  3Comments

voidstate picture voidstate  路  3Comments

packytagliaferro picture packytagliaferro  路  3Comments

sokvebolkol picture sokvebolkol  路  3Comments

AlexanderWM picture AlexanderWM  路  3Comments