changed contract data rows

This commit is contained in:
Frank Schubert
2024-12-03 19:24:17 +01:00
parent e20a528398
commit c7bffed5b1
2 changed files with 13 additions and 10 deletions

View File

@@ -811,12 +811,13 @@ class Contract extends mfBaseModel {
$contract_details = [];
$contract_details['matchcode'] = ['label' => 'Matchcode', 'value' => $contract->matchcode];
$contract_details['owner'] = ['label' => 'Kunde',
'value' => $contract->owner->getCompanyOrName(),
'value' => $contract->owner->getCompanyOrName()." (".$contract->owner->customer_number.")",
'url' => $getUrl('Address', 'View', ['id' => $contract->billingaddress->id])];
$contract_details['billingaddress'] = ['label' => 'Rechnungsadresse', "value" => ""];
if ($contract->billingaddress_id) {
$contract_details['billingaddress'] = ['label' => 'Rechnungsadresse',
'value' => $contract->billingaddress->getCompanyOrName(),
'url' => $getUrl('Address', 'View', ['id' => $contract->billingaddress->id])];
$contract_details['billingaddress']['value'] = $contract->billingaddress->getCompanyOrName()." (".$contract->billingaddress->customer_number.")";
$contract_details['billingaddress']['url'] = $getUrl('Address', 'View', ['id' => $contract->billingaddress->id]);
}
$productName = $contract->product->name;
@@ -824,7 +825,7 @@ class Contract extends mfBaseModel {
$productId = $contract->product_id;
$contract_details['product'] = ['label' => 'Produkt',
'value' => "$contractProductName ($productName) [$productId]",
'value' => "$contractProductName".($productName != $contractProductName ? " ($productName)" : "")." [$productId]",
'url' => $getUrl('Product', 'Edit', ['id' => $contract->product_id])];
if ($contract->prduct_info) {
@@ -858,11 +859,13 @@ class Contract extends mfBaseModel {
if ($contract->billing_delay) $contract_details['billing_delay'] = ['label' => 'Abrechnungsverzögerung',
'value' => $contract->billing_delay . " Monate"];
//$contract_details['space1'] = ['label' => "", "value" => ""];
$contract_details['order_date'] = ['label' => 'Bestelldatum', 'value' => date('d.m.Y', $contract->order_date)];
if ($contract->finish_date) $contract_details['finish_date'] = ['label' => 'Fertigstellung',
'value' => date('d.m.Y', $contract->finish_date) . " (" . $contract->finisher->name . ")"];
if ($contract->cancel_date) $contract_details['cancel_date'] = ['label' => 'Kündigungsdatum',
'value' => date('d.m.Y', $contract->cancel_date) . " (" . $contract->canceler->name . ")"];
$contract_details['finish_date'] = ['label' => 'Fertigstellung',
'value' => ($contract->finish_date) ? date('d.m.Y', $contract->finish_date) . " (" . $contract->finisher->name . ")" : ""];
$contract_details['cancel_date'] = ['label' => 'Kündigungsdatum',
'value' => ($contract->cancel_date) ? date('d.m.Y', $contract->cancel_date) . " (" . $contract->canceler->name . ")" : ""];
//$contract_details['space2'] = ['label' => "", "value" => ""];
$contract_details['create'] = ['label' => 'Erstellt', 'value' => date('d.m.Y', $contract->create) . " (" . $contract->creator->name . ")"];
$contract_details['edit'] = ['label' => 'Geändert', 'value' => date('d.m.Y', $contract->edit) . " (" . $contract->editor->name . ")"];

View File

@@ -124,7 +124,7 @@ class ContractController extends mfBaseController {
"BACK_URL" => isset($_SERVER['HTTP_REFERER']) && str_contains($_SERVER['HTTP_REFERER'], 'Address/View') ? $_SERVER['HTTP_REFERER'] : self::getUrl('Contract', 'Index'),
"EDIT_URL" => self::getUrl('Contract', 'Edit', ['contract_id' => $contract->id, 'f' => 'view']),
"HEADER" => str_contains(strtolower($contract->sla->name), "residential") ? "Privatprodukt" : "Businessprodukt",
"SUB_HEADER" => $contract->product_name . "[" . $contract->id . "]"
"SUB_HEADER" => $contract->product_name . " [" . $contract->id . "]"
]);