Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update invoice template to be (mostly) previewable #24122

Merged
merged 5 commits into from
Aug 17, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Aug 2, 2022

Overview

Switch line items in invoice template to previewable

This is part of standardising contribution templates so that

  • they are decoupled from the form layer and do not rely on form-layer assigns
  • they use consistent, standard variables
  • they work in preview

Before

  • preview does not work
  • $lineItem array variable is used - this is assigned by the form & has an extra 'layer' to iterate through but is otherwise the sames as $lineItems which the WorkflowTemplate class makes available
  • $taxTerm is used - we are moving to tokens where possible so {domain.tax_term}
  • $dataArray is used - we are moving to the $taxRateBreakdown - which has a clearer name & more logical structure

Below output is from generating a pdf & almost no change should happen from this PR - the exception is the dataArray section just seemed wrong on the 'before' so I removed the second line in it

image

  • ie saying Sales Tax 0 in the above seems weird

image

For refunded a credit note section is appended

image

After

image

image

The relevant preview part now works - with gaps which will later be filled with tokens from #24118

image

Technical Details

Once the main parts of the template are swapped we will push a template update & we can, in time, start to remove assignment complexity from the form layer

Comments

@civibot
Copy link

civibot bot commented Aug 2, 2022

(Standard links)

@civibot civibot bot added the master label Aug 2, 2022
@eileenmcnaughton eileenmcnaughton force-pushed the inv_lines branch 2 times, most recently from b285196 to 72f9134 Compare August 2, 2022 07:33
@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Aug 2, 2022

I just added an example to add in the credit note part too

@eileenmcnaughton eileenmcnaughton changed the title Switch line items in invoice template to previewable Update invoice template to be (mostly) previewable Aug 17, 2022
@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy if you get a chance could you take a look at this - it is similar to the changes in the offline contribution template

@demeritcowboy
Copy link
Contributor

Ok I'll try to fit it in somewhere.

@demeritcowboy
Copy link
Contributor

As noted in the description the preview is missing some output, so ok. It's there in the pdf.

But also the logo doesn't seem to display in the preview but it's ok in the pdf.

Otherwise I just have the same UX complaints as before:

  • It should be using my site's config for what choices to preview.
  • If you didn't know there was a preview feature, you might not see it. Even knowing, it takes a while to find it. It should just be a button like the other buttons.

Resulting pdfs look ok. It ignores the tax display setting you have at contribute component settings, but it did that before.

@demeritcowboy demeritcowboy merged commit 2aaf9d4 into civicrm:master Aug 17, 2022
@eileenmcnaughton eileenmcnaughton deleted the inv_lines branch August 17, 2022 21:47
@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy can you put those UI things in gitlab - I'm not really processing them right now but would like to come back to them

@eileenmcnaughton
Copy link
Contributor Author

oh for the logo there is another PR #24102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants