jman <emacs-orgm...@city17.xyz> writes:

> Christian Moe <m...@christianmoe.com> writes:
>> An alternative to defining a STATUS property at all would be to define the
>> statuses as local TODO keywords, which gives you a quick way to look up
>> all unsent or unpaid invoices via the agenda view without having to
>> write match syntax.
>
> I've tried overwriting locally `org-todo-keywords` but I didn't
> understand how: do I need a custom lisp snippet like the following?
>
> --8<---------------cut here---------------start------------->8---
> #+BEGIN_SRC emacs-lisp
>  (setq-local org-todo-keywords
>              '((sequence "TO_BE_SENT" "SENT" "TO_BE_PAID" "PAID")))
> #+END_SRC
> --8<---------------cut here---------------end--------------->8---
>
> but how can I define the override as a PROPERTY?
> And then how can I use the redefined sequence in the invoice entry
> PROPERTY (instead of the `:Status:` property)?

What I had in mind was simply declaring a local todo sequence with

  #+TODO: TO_BE_SENT SENT TO_BE_PAID | PAID

(you may want to put the pipe character before SENT instead, depending
on what you want to be 'done' states)

Starting from the previous example, you could then format your entry
with TO_BE_SENT as a todo state instead of a declared :Status: property,
like this:

  ** TO_BE_SENT Invoice CL161
     :PROPERTIES:
     :Date: [2025-03-02 Sun]
     :No: CL161
     :Amount:   10
     :END:

It can be accessed through the TODO property (a `special', i.e.
built-in, property). In the Invoices heading, in the column-view
definition, change `%STATUS(Status)' to `%TODO(Status)' and remove the
:Status_ALL: property from the previous example.

  * Invoices
    :PROPERTIES:
    :COLUMNS:  %DATE(Invoice Date) %NO(Invoice #) %AMOUNT(Amount) %TODO(Status)
    :END:

I think this version offers a slight advantage in terms of org-agenda,
but the one with a separate :Status: property may suit your workflow or
aesthetics better.

Yours,
Christian

Reply via email to