Skip to content

Feature: positioning elements (manually)#1400

Draft
nielsdrost7 wants to merge 1 commit intoprep/v171from
feat/positioning-elements
Draft

Feature: positioning elements (manually)#1400
nielsdrost7 wants to merge 1 commit intoprep/v171from
feat/positioning-elements

Conversation

@nielsdrost7
Copy link
Contributor

@nielsdrost7 nielsdrost7 commented Jan 20, 2026

Summary by CodeRabbit

  • New Features
    • New settings available to position your logo on the left or right side of PDF invoices and quotes.
    • New option to reverse the layout of customer and company information on PDF documents.

✏️ Tip: You can customize this high-level summary in your review settings.

… (replace #1044) (#1385)

* Feat(pdf): allow reversing logo and customer/company on PDF templates

* Fix the indentation

* Fix comparison

* Update assets/core/scss/_templates.scss

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Ordissimo <thierry@ordissimo.com>
Co-authored-by: Niels Drost <47660417+nielsdrost7@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Two new boolean settings enable configurable PDF layout inversion for invoices and quotes: one reverses customer/company positioning, the other repositions the logo. Settings are exposed in the general settings panel and conditionally applied in PDF templates through CSS ID variants, with supporting stylesheet rules added.

Changes

Cohort / File(s) Summary
Language Configuration
application/language/english/ip_lang.php
Adds 2 new language entries for settings labels: default_reverse_customer_company and default_reverse_logo
Settings UI
application/modules/settings/views/partial_settings_general.php
Introduces 2 new boolean select controls in the general settings form to configure logo and customer/company inversion preferences
PDF Templates
application/views/invoice_templates/pdf/InvoicePlane.php, application/views/quote_templates/pdf/InvoicePlane.php
Conditionally appends "-invert" suffix to logo, client, and company element IDs based on corresponding setting values
Template Styling
assets/core/scss/_templates.scss
Adds CSS rules for inverted layout variants: #logo-invert, #company-invert, and #client-invert with appropriate alignment and spacing adjustments

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • naui95

Poem

🐰 A flip and a flop of the layout divine,
Logo left, company repositioned fine,
Settings now control what the PDF shall show,
Inverted or standard, wherever you go!
CSS rules dancing in perfect array,
Customization hops brightly throughout the day!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feature: positioning elements (manually)' is vague and generic, using non-descriptive language that doesn't convey the specific functionality being added. Consider a more specific title such as 'Add optional logo and company/customer positioning for PDF templates' to clearly describe the feature being implemented.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nielsdrost7
Copy link
Contributor Author

@coderabbitai full review

@nielsdrost7 nielsdrost7 requested a review from Copilot January 20, 2026 07:47
@nielsdrost7 nielsdrost7 self-assigned this Jan 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

✅ Actions performed

Full review triggered.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds configurable options to control the positioning of the logo and the relative positions of customer and company blocks in PDF invoice/quote templates.

Changes:

  • Adds new SCSS rules and IDs to support normal and inverted layouts for logo, client, and company sections in PDF templates.
  • Updates invoice and quote PDF templates to conditionally append -invert to logo, client, and company IDs based on new settings.
  • Extends the general settings UI and English language file with two new options: reversing customer/company order and left-aligning the logo on PDFs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
assets/core/scss/_templates.scss Adds layout rules for #logo-invert, #company-invert, #client, and #client-invert to support inverted header layouts.
application/views/quote_templates/pdf/InvoicePlane.php Makes logo and client/company container IDs conditional on new invert-related settings for quotes.
application/views/invoice_templates/pdf/InvoicePlane.php Makes logo and client/company container IDs conditional on new invert-related settings for invoices.
application/modules/settings/views/partial_settings_general.php Adds two dropdowns under general settings to toggle logo position and customer/company inversion for PDFs.
application/language/english/ip_lang.php Introduces language strings for the new PDF layout settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +80 to +92
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}

`#client` {
float: left;
width: 55%;
margin-right: 5%;
}

`#client-invert` {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS selector here is wrapped in backticks, which makes it invalid SCSS/CSS and prevents the #company-invert rules from applying. This will break the layout when the "invert customer and company" option is enabled, since the corresponding HTML uses id="company-invert" but this rule will never match.

Suggested change
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}
`#client` {
float: left;
width: 55%;
margin-right: 5%;
}
`#client-invert` {
#company-invert {
float: left;
text-align: left;
width: 40%;
}
#client {
float: left;
width: 55%;
margin-right: 5%;
}
#client-invert {

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +92
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}

`#client` {
float: left;
width: 55%;
margin-right: 5%;
}

`#client-invert` {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #client selector is surrounded by backticks, which makes the rule invalid and means none of these layout styles are applied to the client block. As a result, even with the non-inverted layout, the client section may not float/size correctly according to this rule.

Suggested change
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}
`#client` {
float: left;
width: 55%;
margin-right: 5%;
}
`#client-invert` {
#company-invert {
float: left;
text-align: left;
width: 40%;
}
#client {
float: left;
width: 55%;
margin-right: 5%;
}
#client-invert {

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +92
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}

`#client` {
float: left;
width: 55%;
margin-right: 5%;
}

`#client-invert` {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #client-invert selector is also wrapped in backticks, making the rule invalid so the inverted client layout styles (float right, left margin) are never applied. This will cause the customer/company positions not to swap visually when the "invert customer and company" option is turned on.

Suggested change
`#company-invert` {
float: left;
text-align: left;
width: 40%;
}
`#client` {
float: left;
width: 55%;
margin-right: 5%;
}
`#client-invert` {
#company-invert {
float: left;
text-align: left;
width: 40%;
}
#client {
float: left;
width: 55%;
margin-right: 5%;
}
#client-invert {

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
assets/core/scss/_templates.scss (1)

56-96: Remove stray backticks from selectors at lines 80, 86, 92.

Backticks around selectors produce invalid CSS that won't match HTML elements with id="company-invert", id="client", and id="client-invert", causing layout regressions.

🛠️ Proposed fix
-`#company-invert` {
+#company-invert {
   float: left;
   text-align: left;
   width: 40%;
 }
 
-`#client` {
+#client {
   float: left;
   width: 55%;
   margin-right: 5%;
 }
 
-`#client-invert` {
+#client-invert {
   float: right;
   width: 55%;
   margin-left: 5%;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants