![](http://content.invisioncic.com/r49260/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Billz
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Billz
-
-
On 10/5/2022 at 10:13 AM, Billz said:
@davejplease help me.
-
@davejplease help me.
-
Please help me let me explain with this.....
purchase table
1
1
1
NULL
NULL
NULL
10
10
1
40
0
0
0
400
2022-10-01 14:37:01
2022-10-01 14:37:01
2
2
1
NULL
NULL
NULL
15
15
1
45
0
0
0
675
2022-10-01 14:39:09
2022-10-01 14:39:09
3
3
1
NULL
NULL
NULL
15
15
1
48
0
0
0
720
2022-10-01 14:40:44
2022-10-01 14:40:44
Sale Table
1
1
10
50
500
2022-10-01 14:37:22
2
1
10
50
500
2022-10-01 14:39:35
3
1
15
50
750
2022-10-01 14:41:12
4
1
5
50
250
2022-10-01 15:55:21
5
1
1
50
50
2022-10-03 15:02:43
6
1
1
40
40
2022-10-03 15:06:12
7
1
1
40
40
2022-10-03 15:06:15
in this, if i sold '11' units then how can i subtract from the rows to get remaining units? i've to subtract '10' units from first row and '1' unit from second row.
Please help how to calculate fifo in php -
hello davej i need your help.
Fifo Method Calculation php
in PHP
Posted
Please help me let me explain with this.....
```
purchase table
id purchase_id product_id qty net_unit_cost created_at
1 1 1 10 10 2022-10-10
2 2 1 20 12 2022-10-10
Sale table
sale_id product_id qty net_unit_price created_at
1 1 11 15 2022-10-10
```
in this, if i sold '11' units then how can i subtract from the rows to get remaining units? i've to subtract '10' units from first row and '1' unit from second row.
Please help how to calculate fifo in php