Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Webkul\Sales\Traits; trait PaymentTerm { /** * Wether the core ..
Decoded Output download
<?php
namespace Webkul\Sales\Traits;
trait PaymentTerm
{
/**
* Wether the core config have payment term or not.
*
* @return bool
*/
public function hasPaymentTerm()
{
return (bool) $this->getPaymentTerm();
}
/**
* Get payment term from the core config in days.
*
* @return int
*/
public function getPaymentTerm()
{
return (int) core()->getConfigData('sales.invoice_settings.payment_terms.due_duration');
}
/**
* Formatted payment terms for invoice. Handled singular and plural case also.
*
* @return string
*/
public function getFormattedPaymentTerm()
{
$dueDuration = $this->getPaymentTerm();
if ($dueDuration > 1) {
return __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-days', ['due-duration' => $dueDuration]);
}
return $dueDuration
? __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-day', ['due-duration' => $dueDuration])
: __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-day', ['due-duration' => 0]);
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Webkul\Sales\Traits;
trait PaymentTerm
{
/**
* Wether the core config have payment term or not.
*
* @return bool
*/
public function hasPaymentTerm()
{
return (bool) $this->getPaymentTerm();
}
/**
* Get payment term from the core config in days.
*
* @return int
*/
public function getPaymentTerm()
{
return (int) core()->getConfigData('sales.invoice_settings.payment_terms.due_duration');
}
/**
* Formatted payment terms for invoice. Handled singular and plural case also.
*
* @return string
*/
public function getFormattedPaymentTerm()
{
$dueDuration = $this->getPaymentTerm();
if ($dueDuration > 1) {
return __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-days', ['due-duration' => $dueDuration]);
}
return $dueDuration
? __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-day', ['due-duration' => $dueDuration])
: __('admin::app.configuration.index.sales.invoice-settings.payment-terms.due-duration-day', ['due-duration' => 0]);
}
}
Function Calls
None |
Stats
MD5 | 35f85827e546c14a4ba15a5aa5752dad |
Eval Count | 0 |
Decode Time | 102 ms |