Forum Discussion
V1668
Feb 25, 2024Copper Contributor
Excel (Online): How do you create order templates, ordered, to deduct from main inventory?
Hi, So I am trying to create order templates in one tab e.g. product A consists of 1,2 &3, product B consists of 1,4&5 etc Then if customer A buys product A & customer B buys product A&B, in a se...
peiyezhu
Feb 26, 2024Bronze Contributor
managed to do an in and out stock levels
If you want calculate the stock in hand or balance,I prefer input all stock in and out in one table so that you can get balance of each product more easily by sql
e.g.
create temp table aa as
select amount,debit,customer,memo,checked from stock where debit<>'select one' union all
select -amount,credit,customer,memo,checked from stock where credit<>'select one' ;
select *,sum(amount) over ( partition by debit order by checked) balance from aa;
amount debit credit customer memo checked
| 10 | product_a | select one | customer_a | buy,increase stock | 2024-02-26 08:49:40-65dbe024c9fdd |
| 2 | select one | product_a | customer_a | sale,decrease stock | 2024-02-26 08:50:15-65dbe04785fb8 |
Stock
amount
debit
select oneproduct_a product_b product_c
credit
select oneproduct_a product_b product_c
customer
memo
Submit提交Reset重置
- peiyezhuFeb 26, 2024Bronze Contributor