I'd like to extend the invoicing in the following way:

Either admin setting or permission to include "not published" invoices in views and list (for "add to invoice").

This way, users can prepare the invoice in total, adding all records they want before the customer can see it (or notified about it).

Not sure if anyone is interested and if so, whether to use:
1) admin setting (which will mean all users would be affected)
2) new permission (we have quite a few permissions already so not too keen on this)
3) existing permission: either "Storm invoice: view all" or "administer nodes" (which gives permission to change published state).

I'd be happy to code it (or try).

Comments?

Comments

juliangb’s picture

I don't like the idea in general of using the unpublished to store something like this.

What about a 'draft' status?

tchurch’s picture

I was thinking about using existing functions rather than adding a new status.

I found a module that we might be able to integrate into Storm (as a dependency).

http://drupal.org/project/view_unpublished

This would allow people to select which node types they want to allow users to view (i.e. one might want to prepare a project before giving others access to use/view it).

I think that people using Views can use existing "published" flags to allow it too.

It all lists/drop down lists for items used this function then users only see what they're allowed to see.

Not sure about dependencies. I think we have to go that way rather that "re-inventing the wheel".

tchurch’s picture

Assigned: Unassigned » tchurch

I'd like to work on this for version 1.35.

I have a customer who's interested in having this function.

I'd also like to extend this so that"add to existing invoice" only shows invoices that are unpublished/draft (whatever is decided).

I'm not too sure about having another column (i.e. status) although if people think this is best then we could do that.

I could increase the number of permissions Storm has but if we incorporate the current published/unpublished permissions then the drop-down lists and other things too could use existing permissions for this.

What do people think?

juliangb’s picture

It'd be good to have a third opinion on this one.

tchurch’s picture

I've been thinking about this further.

For my customer, I've now used the published flag to remove all old invoices from view (i.e. previous tax years) but they can still see them if needed.
This means that it might be better to create a new status field.

Then items can only be added to draft invoices.

What do people think?

tchurch’s picture

Maybe could expand this to cover the following issues:
#835360: Flag - invoice "sent to customer".
#468694: Completed tasks
#782858: Allowing viewing/adding to "not published" invoices

1) New column on an attribute - "locked". If this attribute should be treated as not allowed (if function available). A tick box, like active/default.
2) A new attribute for "invoice status" - Users can define their own values but defaults would be:
draft, final (locked), sent (locked).
3) Change viewing of invoices in drop-down for "add to existing" to not show locked invoice numbers.
4) Remove "edit"/"delete" options from all Storm node types if node is locked.
5) Change all drop-down lists to remove locked items (so users cannot add sub-items to completed/locked items).

Open points:
1) New permissions to allow view/edit/delete of locked items?
May not be needed. Just change status if you want to change it.

I would try and split the patches logically over the issues to add the features in the correct place.

juliangb’s picture

Seems like a good way to deal with the 3 issues.

tchurch’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

I've been away from Storm development for a while (working on customer Drupal sites) but I'd like to get this issue done now.

I'll be 'hacking' 1.36 for my customer using the published flag for now but I'd like to get a permanent solution in place.

I think we should use a new flag/attribute, as mentioned in #6.

Are there any other opinions?