-
Notifications
You must be signed in to change notification settings - Fork 0
/
sale.Rmd
90 lines (68 loc) · 2.5 KB
/
sale.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
output: pdf_document
---
*SALES REPORT*
# Stock & Sales Report of Sri Vijayasree <font size="10">
### Date: `r format(Sys.Date(), "%B %d, %Y")`
```{r echo=FALSE, message=FALSE}
# install.packages(googlesheets4)
# install.packages(tidyverse)
# install.packages(readxl)
# install.packages(janitor)
# install.packages(gt)
```
```{r echo=FALSE, message=FALSE}
library(googlesheets4)
library(tidyverse)
library(readxl)
library(janitor)
library(gt)
```
```{r echo=FALSE, message=FALSE}
gs4_auth(email = 'srivijayasree100@gmail.com')
```
## 1. Opening stock
```{r echo=FALSE, message=FALSE}
stock <- read_sheet('https://docs.google.com/spreadsheets/d/11cEs7BGhWz256TbTzW1OU8AMcctfvk6cxgblJiYCs7Y/edit?usp=sharing', sheet = 'data-products' )
stock1 <- janitor::clean_names(stock)
```
```{r echo=FALSE, message=FALSE}
todaysstock <- stock1 %>%
mutate(Product= data_products_product,
Category=data_products_category,
Detail= data_products_details,
Boxes= data_products_boxes,
Box_detail=data_products_boxes_detail) %>%
group_by(Product,Category, Detail) %>% summarise(Procurment=sum(Box_detail), .groups = 'drop')
todaysstock %>% gt()
```
```{r echo=FALSE, message=FALSE}
sale <- sale <- read_sheet('https://docs.google.com/spreadsheets/d/1HKIX8O5FlycBnk4IEv0oz86CVvMmnQsIU_AG5AzPK9w/edit#gid=0', sheet = 'data-products')
sale1 <- janitor::clean_names(sale)
```
## 2. Sale
```{r echo=FALSE, message=FALSE}
todayssale <- sale1 %>%
mutate(Product= data_products_product,
Category=data_products_category,
Detail= data_products_details,
Boxes= data_products_boxes,
Box_detail=data_products_boxes_detail) %>%
group_by(Product,Category, Detail) %>% summarise(Sale=sum(Box_detail), .groups = 'drop')
todayssale %>% gt()
```
## 3. Closing stock
```{r echo=FALSE, message=FALSE}
saleStock <- full_join(x = todaysstock, y = todayssale)
saleStock %>% group_by(Product,Category, Detail,Procurment, Sale) %>%
select(Sale) %>% mutate_at(vars(Sale), ~replace_na(., 0)) %>%
summarise(ClosingStock= Procurment-Sale,.groups = 'drop') %>% gt()
```
### Prepared by Sanesh
`r format(Sys.Date(), "%B %d, %Y")`
Madanapalle
*.....................................*
\begingroup
\fontfamily{phv}\fontsize{6}{18}\selectfont
Produced with RStudio, Googlesheet by cssaneesh@gmail.com
\endgroup