Created
April 20, 2022 04:06
-
-
Save alfanjauhari/b9d879038949fd740007b3b02f598f21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = [ | |
{ | |
"purchase": { | |
"total_sales": 300, | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 200, | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
}, | |
"order": { | |
"total_sales": 400, | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 0, | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
} | |
}, | |
{ | |
"purchase": { | |
"total_sales": 100, | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 100, | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
}, | |
"order": { | |
"total_sales": 400, | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 0, | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
} | |
}, | |
] | |
const expectedData = [ | |
{ | |
"purchase": { | |
"total_sales": 400, // penjumlahan dengan purchase total sales purchase yang lain | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 300, // penjumlahan dengan purchase set cost ratio yang lain | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
}, | |
"order": { | |
"total_sales": 800, // penjumlahan dengan order total sales yang lain | |
"sales": 0, | |
"discount_ratio": 0, | |
"set_cost_ratio": 0, | |
"cost_of_sales": 0, | |
"gross_profit": 0, | |
"gross_profit_ratio": 0, | |
"period_start_inventory": 0, | |
"purchase_amount": 0, | |
"period_end_inventory": 0, | |
"inventory_turnover": 0 | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment