mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +00:00
refactor(FE): Show zero values in RecordingForm
This commit is contained in:
@@ -1640,15 +1640,13 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-3 font-medium'>FCR</td>
|
<td className='py-3 font-medium'>FCR</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.fcr_value &&
|
{initialValues.fcr_value != null
|
||||||
initialValues.fcr_value > 0
|
|
||||||
? formatNumber(initialValues.fcr_value)
|
? formatNumber(initialValues.fcr_value)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.fcr?.fcr_std &&
|
{initialValues.project_flock?.fcr?.fcr_std != null
|
||||||
initialValues.project_flock?.fcr?.fcr_std > 0
|
|
||||||
? formatNumber(
|
? formatNumber(
|
||||||
initialValues.project_flock?.fcr?.fcr_std
|
initialValues.project_flock?.fcr?.fcr_std
|
||||||
)
|
)
|
||||||
@@ -1659,17 +1657,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-3 font-medium'>Feed Intake (KG)</td>
|
<td className='py-3 font-medium'>Feed Intake (KG)</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.feed_intake &&
|
{initialValues.feed_intake != null
|
||||||
initialValues.feed_intake > 0
|
|
||||||
? formatNumber(initialValues.feed_intake)
|
? formatNumber(initialValues.feed_intake)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.production_standart
|
{initialValues.project_flock?.production_standart
|
||||||
?.feed_intake_std &&
|
?.feed_intake_std != null
|
||||||
initialValues.project_flock?.production_standart
|
|
||||||
?.feed_intake_std > 0
|
|
||||||
? formatNumber(
|
? formatNumber(
|
||||||
initialValues.project_flock?.production_standart
|
initialValues.project_flock?.production_standart
|
||||||
?.feed_intake_std
|
?.feed_intake_std
|
||||||
@@ -1696,8 +1691,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-2 font-medium'>Deplesi Kumulatif</td>
|
<td className='py-2 font-medium'>Deplesi Kumulatif</td>
|
||||||
<td className='text-right py-2'>
|
<td className='text-right py-2'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.cum_depletion_rate &&
|
{initialValues.cum_depletion_rate != null
|
||||||
initialValues.cum_depletion_rate > 0
|
|
||||||
? `${initialValues.cum_depletion_rate.toFixed(2)}%`
|
? `${initialValues.cum_depletion_rate.toFixed(2)}%`
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
@@ -1706,8 +1700,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<tr>
|
<tr>
|
||||||
<td className='py-2 font-medium'>Total Depletion</td>
|
<td className='py-2 font-medium'>Total Depletion</td>
|
||||||
<td className='text-right py-2 font-semibold'>
|
<td className='text-right py-2 font-semibold'>
|
||||||
{initialValues.total_depletion_qty &&
|
{initialValues.total_depletion_qty != null
|
||||||
initialValues.total_depletion_qty > 0
|
|
||||||
? formatNumber(initialValues.total_depletion_qty)
|
? formatNumber(initialValues.total_depletion_qty)
|
||||||
: '-'}
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
@@ -1716,8 +1709,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<tr className='border-t border-gray-200'>
|
<tr className='border-t border-gray-200'>
|
||||||
<td className='py-2 text-gray-600'>Total Ayam</td>
|
<td className='py-2 text-gray-600'>Total Ayam</td>
|
||||||
<td className='text-right py-2 font-semibold'>
|
<td className='text-right py-2 font-semibold'>
|
||||||
{initialValues.project_flock?.total_chick_qty &&
|
{initialValues.project_flock?.total_chick_qty != null
|
||||||
initialValues.project_flock?.total_chick_qty > 0
|
|
||||||
? formatNumber(
|
? formatNumber(
|
||||||
initialValues.project_flock?.total_chick_qty
|
initialValues.project_flock?.total_chick_qty
|
||||||
)
|
)
|
||||||
@@ -1759,17 +1751,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-3 font-medium'>Egg Mass</td>
|
<td className='py-3 font-medium'>Egg Mass</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.egg_mass &&
|
{initialValues.egg_mass != null
|
||||||
initialValues.egg_mass > 0
|
|
||||||
? formatNumber(initialValues.egg_mass)
|
? formatNumber(initialValues.egg_mass)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.production_standart
|
{initialValues.project_flock?.production_standart
|
||||||
?.egg_mass_std &&
|
?.egg_mass_std != null
|
||||||
initialValues.project_flock?.production_standart
|
|
||||||
?.egg_mass_std > 0
|
|
||||||
? formatNumber(
|
? formatNumber(
|
||||||
initialValues.project_flock
|
initialValues.project_flock
|
||||||
?.production_standart?.egg_mass_std
|
?.production_standart?.egg_mass_std
|
||||||
@@ -1783,17 +1772,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.egg_weight &&
|
{initialValues.egg_weight != null
|
||||||
initialValues.egg_weight > 0
|
|
||||||
? formatNumber(initialValues.egg_weight)
|
? formatNumber(initialValues.egg_weight)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.production_standart
|
{initialValues.project_flock?.production_standart
|
||||||
?.egg_weight_std &&
|
?.egg_weight_std != null
|
||||||
initialValues.project_flock?.production_standart
|
|
||||||
?.egg_weight_std > 0
|
|
||||||
? formatNumber(
|
? formatNumber(
|
||||||
initialValues.project_flock
|
initialValues.project_flock
|
||||||
?.production_standart?.egg_weight_std
|
?.production_standart?.egg_weight_std
|
||||||
@@ -1805,17 +1791,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-3 font-medium'>Hen Day</td>
|
<td className='py-3 font-medium'>Hen Day</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.hen_day &&
|
{initialValues.hen_day != null
|
||||||
initialValues.hen_day > 0
|
|
||||||
? formatNumber(initialValues.hen_day)
|
? formatNumber(initialValues.hen_day)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.production_standart
|
{initialValues.project_flock?.production_standart
|
||||||
?.hen_day_std !== undefined &&
|
?.hen_day_std != null
|
||||||
initialValues.project_flock?.production_standart
|
|
||||||
?.hen_day_std > 0
|
|
||||||
? `${initialValues.project_flock?.production_standart?.hen_day_std}%`
|
? `${initialValues.project_flock?.production_standart?.hen_day_std}%`
|
||||||
: '-'}
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
@@ -1824,17 +1807,14 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
<td className='py-3 font-medium'>Hen House</td>
|
<td className='py-3 font-medium'>Hen House</td>
|
||||||
<td className='text-center py-3'>
|
<td className='text-center py-3'>
|
||||||
<span className='font-semibold'>
|
<span className='font-semibold'>
|
||||||
{initialValues.hen_house &&
|
{initialValues.hen_house != null
|
||||||
initialValues.hen_house > 0
|
|
||||||
? formatNumber(initialValues.hen_house)
|
? formatNumber(initialValues.hen_house)
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className='text-center py-3 text-gray-600'>
|
<td className='text-center py-3 text-gray-600'>
|
||||||
{initialValues.project_flock?.production_standart
|
{initialValues.project_flock?.production_standart
|
||||||
?.hen_house_std !== undefined &&
|
?.hen_house_std != null
|
||||||
initialValues.project_flock?.production_standart
|
|
||||||
?.hen_house_std > 0
|
|
||||||
? `${initialValues.project_flock?.production_standart?.hen_house_std}%`
|
? `${initialValues.project_flock?.production_standart?.hen_house_std}%`
|
||||||
: '-'}
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user