1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Revert attempting to use divs as tables

This commit is contained in:
David Bomba 2023-01-31 09:25:40 +11:00
parent 5ca0bf3b23
commit c7701b71d6
3 changed files with 68 additions and 24 deletions

View File

@ -306,7 +306,7 @@ class Design extends BaseDesign
return $elements;
}
public function entityDetails(): array
public function entityDetailsx(): array
{
@ -379,7 +379,7 @@ class Design extends BaseDesign
}
public function entityDetailsx(): array
public function entityDetails(): array
{
@ -457,6 +457,7 @@ class Design extends BaseDesign
return $elements;
}
public function deliveryNoteTable(): array
{
if ($this->type !== self::DELIVERY_NOTE) {

View File

@ -246,7 +246,44 @@ trait DesignHelpers
]];
}
public function entityVariableCheck(string $variable): string
public function entityVariableCheck(string $variable): bool
{
// Extract $invoice.date => date
// so we can append date as $entity->date and not $entity->$invoice.date;
// When it comes to invoice balance, we'll always show it.
if ($variable == '$invoice.total') {
return false;
}
// Some variables don't map 1:1 to table columns. This gives us support for such cases.
$aliases = [
'$quote.balance_due' => 'partial',
];
try {
$_variable = explode('.', $variable)[1];
} catch (Exception $e) {
throw new Exception('Company settings seems to be broken. Missing $entity.variable type.');
}
if (\in_array($variable, \array_keys($aliases))) {
$_variable = $aliases[$variable];
}
if (is_null($this->entity->{$_variable})) {
return true;
}
if (empty($this->entity->{$_variable})) {
return true;
}
return false;
}
public function entityVariableCheckx(string $variable): string
{
// Extract $invoice.date => date
// so we can append date as $entity->date and not $entity->$invoice.date;

View File

@ -34,11 +34,6 @@
padding: 0;
}
span {
border-right:10px;
}
#qr-bill {
width:100% !important;
box-sizing: border-box;
@ -57,7 +52,8 @@
}
.company-logo {
max-width: $company_logo_size;
max-width: 65%;
/* max-width: $company_logo_size;*/
}
#company-details {
@ -86,32 +82,34 @@
}
.client-and-entity-wrapper {
display: flex;
padding: 0.2rem;
/* display: flex;*/
padding: 1rem;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
border-top: 1px solid #d8d8d8;
border-bottom: 1px solid #d8d8d8;
}
#entity-details {
display: table;
padding-right: 30px;
flex-direction: column;
overflow: hidden;
height: 12px;
white-space: nowrap;
line-height: var(--line-height);
display:flex;
text-align: left;
margin-right: 20px;
}
.entity-details-cell {
display: table-cell;
border-right: 10px solid transparent;
#entity-details > tr,
#entity-details th {
font-weight: normal;
padding-right: 15px;
padding-top: 2.5px;
padding-bottom: 2.5px;
}
#client-details {
display: flex;
flex-direction: column;
padding-right: 30px;
line-height: var(--line-height);
padding-right:30px;
}
#shipping-details {
@ -120,6 +118,12 @@
line-height: var(--line-height);
}
#client-details {
display: flex;
flex-direction: column;
line-height: var(--line-height);
}
#client-details > :first-child {
font-weight: bold;
}
@ -367,7 +371,9 @@
</div>
<p class="entity-label">$entity_label</p>
<div class="client-and-entity-wrapper">
<div id="entity-details"></div>
<div>
<table id="entity-details" cellspacing="0" dir="$dir"></table>
</div>
<div id="client-details"></div>
<div id="vendor-details"></div>
<div id="shipping-details"></div>
@ -423,4 +429,4 @@ $entity_images
});
</script>
</div>
</div>