Document field default name

This commit is contained in:
Cüneyt Şentürk
2020-12-28 22:10:43 +03:00
parent 50eaa40327
commit 918c5af23e
5 changed files with 197 additions and 338 deletions

View File

@ -102,7 +102,7 @@ abstract class DocumentShow extends Component
/** @var string */
public $permissionButtonCustomize;
/** @var bool */
public $hideButtonGroupDivider1;
@ -316,7 +316,7 @@ abstract class DocumentShow extends Component
public $hidePrice;
public $hideDiscount;
public $hideAmount;
/** @var string */
@ -512,16 +512,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textRecurringType = 'general.invoices';
break;
case 'bill':
case 'expense':
case 'purchase':
$textRecurringType = 'general.bills';
break;
default:
$textRecurringType = 'general.invoices';
break;
}
return $textRecurringType;
@ -534,16 +532,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textStatusMessage = 'invoices.messages.draft';
break;
case 'bill':
case 'expense':
case 'purchase':
$textStatusMessage = 'bills.messages.draft';
break;
default:
$textStatusMessage = 'invoices.messages.draft';
break;
}
return $textStatusMessage;
@ -629,16 +625,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textHistories = 'invoices.histories';
break;
case 'bill':
case 'expense':
case 'purchase':
$textHistories = 'bills.histories';
break;
default:
$textHistories = 'invoices.histories';
break;
}
return $textHistories;
@ -651,16 +645,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textHistoryStatus = 'invoices.statuses.';
break;
case 'bill':
case 'expense':
case 'purchase':
$textHistoryStatus = 'bills.statuses.';
break;
default:
$textHistoryStatus = 'invoices.statuses.';
break;
}
return $textHistoryStatus;
@ -1013,16 +1005,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textHeaderContact = 'general.customers';
break;
case 'bill':
case 'expense':
case 'purchase':
$textHeaderContact = 'general.vendors';
break;
default:
$textHeaderContact = 'general.customers';
break;
}
return $textHeaderContact;
@ -1088,16 +1078,7 @@ abstract class DocumentShow extends Component
return $hideTimelineStatuses;
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
case 'bill':
case 'expense':
case 'purchase':
$hideTimelineStatuses = ['paid', 'cancelled'];
break;
}
$hideTimelineStatuses = ['paid', 'cancelled'];
return $hideTimelineStatuses;
}
@ -1127,16 +1108,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineSentTitle = 'invoices.send_invoice';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineSentTitle = 'bills.receive_bill';
break;
default:
$textTimelineSentTitle = 'invoices.send_invoice';
break;
}
return $textTimelineSentTitle;
@ -1149,16 +1128,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineSentStatusDraft = 'invoices.messages.status.send.draft';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineSentStatusDraft = 'bills.messages.status.receive.draft';
break;
default:
$textTimelineSentStatusDraft = 'invoices.messages.status.send.draft';
break;
}
return $textTimelineSentStatusDraft;
@ -1171,16 +1148,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineSentStatusMarkSent = 'invoices.mark_sent';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineSentStatusMarkSent = 'bills.mark_received';
break;
default:
$textTimelineSentStatusMarkSent = 'invoices.mark_sent';
break;
}
return $textTimelineSentStatusMarkSent;
@ -1193,16 +1168,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineSentStatusReceived = 'invoices.mark_sent';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineSentStatusReceived = 'bills.mark_received';
break;
default:
$textTimelineSentStatusReceived = 'invoices.mark_sent';
break;
}
return $textTimelineSentStatusReceived;
@ -1215,14 +1188,12 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineSendStatusMail = 'invoices.send_mail';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineSendStatusMail = 'bills.send_mail';
break;
default:
$textTimelineSendStatusMail = 'invoices.send_mail';
break;
}
@ -1237,16 +1208,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineGetPaidTitle = 'invoices.get_paid';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineGetPaidTitle = 'bills.make_payment';
break;
default:
$textTimelineGetPaidTitle = 'invoices.get_paid';
break;
}
return $textTimelineGetPaidTitle;
@ -1259,16 +1228,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineGetPaidStatusAwait = 'invoices.messages.status.paid.await';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineGetPaidStatusAwait = 'bills.messages.status.paid.await';
break;
default:
$textTimelineGetPaidStatusAwait = 'invoices.messages.status.paid.await';
break;
}
return $textTimelineGetPaidStatusAwait;
@ -1292,16 +1259,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineGetPaidMarkPaid = 'invoices.mark_paid';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineGetPaidMarkPaid = 'bills.mark_paid';
break;
default:
$textTimelineGetPaidMarkPaid = 'invoices.mark_paid';
break;
}
return $textTimelineGetPaidMarkPaid;
@ -1314,16 +1279,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$textTimelineGetPaidAddPayment = 'invoices.add_payment';
break;
case 'bill':
case 'expense':
case 'purchase':
$textTimelineGetPaidAddPayment = 'bills.add_payment';
break;
default:
$textTimelineGetPaidAddPayment = 'invoices.add_payment';
break;
}
return $textTimelineGetPaidAddPayment;
@ -1347,16 +1310,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hideName = setting('invoice.hide_item_name', $hideName);
break;
case 'bill':
case 'expense':
case 'purchase':
$hideName = setting('bill.hide_item_name', $hideName);
break;
default:
$hideName = setting('invoice.hide_item_name', $hideName);
break;
}
return $hideName;
@ -1369,16 +1330,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hideDescription = setting('invoice.hide_item_description', $hideDescription);
break;
case 'bill':
case 'expense':
case 'purchase':
$hideDescription = setting('bill.hide_item_description', $hideDescription);
break;
default:
$hideDescription = setting('invoice.hide_item_description', $hideDescription);
break;
}
return $hideDescription;
@ -1391,16 +1350,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hideQuantity = setting('invoice.hide_quantity', $hideQuantity);
break;
case 'bill':
case 'expense':
case 'purchase':
$hideQuantity = setting('bill.hide_quantity', $hideQuantity);
break;
default:
$hideQuantity = setting('invoice.hide_quantity', $hideQuantity);
break;
}
return $hideQuantity;
@ -1413,16 +1370,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hidePrice = setting('invoice.hide_price', $hidePrice);
break;
case 'bill':
case 'expense':
case 'purchase':
$hidePrice = setting('bill.hide_price', $hidePrice);
break;
default:
$hidePrice = setting('invoice.hide_price', $hidePrice);
break;
}
return $hidePrice;
@ -1435,16 +1390,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hideDiscount = setting('invoice.hide_discount', $hideDiscount);
break;
case 'bill':
case 'expense':
case 'purchase':
$hideDiscount = setting('bill.hide_discount', $hideDiscount);
break;
default:
$hideDiscount = setting('invoice.hide_discount', $hideDiscount);
break;
}
return $hideDiscount;
@ -1457,16 +1410,14 @@ abstract class DocumentShow extends Component
}
switch ($type) {
case 'sale':
case 'income':
case 'invoice':
$hideAmount = setting('invoice.hide_amount', $hideAmount);
break;
case 'bill':
case 'expense':
case 'purchase':
$hideAmount = setting('bill.hide_amount', $hideAmount);
break;
default:
$hideAmount = setting('invoice.hide_amount', $hideAmount);
break;
}
return $hideAmount;