Ứng Dụng Quản Lý Bán Hàng Với SharePoint 2016 – Lab Sharepoint 2016 Phần 15

Bạn đang cần chương trình quản lý bán hàng và tính tồn kho, khi nhập sản phẩm sẽ cộng dồn số lượng vào kho, ngược lại khi xuất phải trử số lượng trong kho tương ứng cho từng sản phẩm nhập hay xuất. Khi nhập hay xuất có thể nhập xuất nhiều sản phẩm cùng lúc. Sharepoint sẽ giúp bạn xây dựng chương trình quản lý này.

Các Bước Triển Khai Ứng Dụng Quản Lý Bán Hàng Với SharePoint 2016:

Bài LAB này được chia làm các bước sau:

  • Tạo Subsite Quản lý Tồn Kho,Cấp quyền
  • Tạo List Sản Phẩm, tạo column list sản phẩm
  • Edit form nhập sản phẩm
  • Tạo List phiếu nhập, tạo column list phiếu nhập
  • Tạo workflow sản phẩm nhập
  • Thiết kế form phiếu nhập
  • Tạo list phiếu xuất, tạo column phiếu xuất
  • Tạo workflow sản phẩm xuất
  • Thiết kế form phiếu xuất
  • Tạo View
  • Kiểm Tra

Mục đích của bài lab: hướng dẫn sử dụng sharepoint designer 2013 để tính toán xuất nhập sản phẩm

Thực Hiện Ứng Dụng Quản Lý Bán Hàng Với SharePoint 2016:

B1: Tạo Subsite Quản lý tồn kho và cấp quyền.

B1: Tạo Subsite Quản lý tồn kho và cấp quyền. Tại site Internal.nhatnghe.local vào setting\Site Contents

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Chọn New subsite trong phần subsite

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Title: Quan Ly Ton Kho,

URL name: QLTK,

Select a template: Team Site

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Chọn option Use Unique permissions Create

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Chọn Option Create a new group, cấp quyền cho Visitors, members và owners Ok

picture005

B2. Tạo List Sản Phẩm, tạo column list sản phẩm.

B2. Tạo List Sản Phẩm, tạo column list sản phẩm. Tại site Quản lý tồn kho vào Setting\Add an app

picture006

Chọn Custom List

picture007

Name: SanPham Create

picture008

Tại list sản phẩm chọn tab list Create Column

picture009

Column Name: Ten san Pham, chọn option Single line of text

picture010

Chọn option Yes trong phần Require that this column contains information Ok

picture011

Tiếp tục tạo column Soluong, chọn option Number

picture013

Tiếp tục tạo column Gia, chọn option Currency

picture015

Currency format: Vietnam đồng

picture016

Chọn List sản phẩm chọn tab list\list settings

picture017

Chọn List name, description and navigation

picture018

Sửa name thành Sản Phẩm (tiếng viết có dấu) Save

picture019

Chọn Title trong phần columns

picture020

Đổi column name: Masp OK

picture021

B3. Edit form nhập sản phẩm.

B3. Edit form nhập sản phẩm. chọn list sản phẩm chọn list Customize form

picture023

Đánh dấu và xóa dòng Attachments

picture024

Thiết kế lại form thông tin sản phẩm như trong hình

picture025

Vào tab home trong controls add thêm 2 button

picture026

Phải chuột vào 1 button chọn button properties

picture027

Action: Rules, Label: Save Ok

picture028

Phải chuột vào button còn lại chọn button properties.

Action: Rules, Label: Thoát Ok

picture029

Chọn text box soluong chọn text box properties

Default value: 0 Ok

picture030

Chọn text box Gia chọn text box properties

Default value: 0 Ok

picture032

Chọn button Save, vào tab Home Manage Rules chọn New Action

picture033

Đặt tên rule save, Chọn None-rule runs when button trong phần condition

Set điều kiện như trong hình Ok

picture035

Ấn Add chọn Submit using a data connection và close this form

picture036

Chọn button thoát, chọn New Action

picture037

Đặt tên Rule thoát, ấn Add chọn Close this form, thiết kế form xong

picture038

Vào Tab File\ info chọn Form Options

picture039

Trong phần Web Browser bỏ chọn checkbox Show infopath commands in Ribbon or toolbar ok

picture040

Chọn Publish SharePoint List. Trở về site Quản lý tồn kho nhập liệu thử cho list sản phẩm

picture041

B4. Tạo List phiếu nhập, tạo column list phiếu nhập.

B4. Tạo List phiếu nhập, tạo column list phiếu nhập. Trở lại Site quản lý tồn kho vào settings Add an app

picture042

Chọn custom list

picture043

Name: PhieuNhap Create

picture044

Chọn phiếu nhập vào List chọn Create column

picture045

Column name: TenSanPhamNhap, chọn option Lookup

picture046

Chọn Sản Phẩm trong Get information from, Chọn ten san pham trong In this column

picture047

Tại Phiếu nhập tiếp tục chọn Create column

Column name: Soluongnhap chọn option Number

picture049

Trả lời Yes trong Require that this column…

picture050

Trong phần Column validation nhập vào Soluongnhap>=0 trong phần Formula. Trong phần User message: So luong nhap khong hop le ok

picture001

Tại Phiếu nhập tiếp tục chọn Create column

Column name: Gianhap, chọn option Currency

picture052

Trả lời Yes trong Require that this column…

picture053

Currency format: Vietnam đồng

picture054

Trong phần Column Validation kiểm tra Gianhap>=0 ok

picture002

Tại List phiếu nhập chọn List\list settings

picture055

Chọn List name, decription and navigation

picture056

Sửa Name: Phiếu Nhập (tiếng Việt) Save

picture057

Chọn Title trong phần column

picture058

Sửa Column name: MaPhieuNhap Ok

picture059

B5. Tạo workflow sản phẩm nhập

B5. Tạo workflow sản phẩm nhập, Chọn Phiếu Nhập vào List Create a workflow in sharepoint designer

picture061

Ấn Allow

picture062

Đặt tên workflow: san Pham Nhap, Platform type: Sharepoint 2013 workflow Ok

picture063

Đặt con trỏ vào phần Stage 1 vào action chọn Do calculation

picture064

Trong calculate click vào Value.

picture065

Click vào Fx

picture066

Data Source: sản Phẩm, Field from source: Soluong, Field: ID, value ấn Fx

picture067

Data source: current item, Field from source: tensanphamnhap

Return field as: Lookup Id(as interger) Ok

picture068

Ok

picture069

Chọn Plus

picture070

Click vào value thứ 2

picture071

ấn Fx

picture072

Data source: Current Item, Field from source: Soluongnhap Ok

picture073

Trong phần Output to chọn Create a new variable

picture074

Name: TinhNhap, Type: Number

picture075

Workflow sẽ lấy số lượng trong list sản phẩm cộng với số lượng nhập hiện tại đặt vào biến Tinhnhap

picture076

Đặt con trỏ trong phần Transition to Stage, vào Condition chọn If any value equals value

picture077

Trong If chọn value đầu tiên

picture078

ấn Fx

picture079

Data source: Workflow variables and Parameters, Field from source: Variable Tinhnhap

picture080

Chọn Is greater than

picture081

Ấn value thứ 2

picture082

ấn Fx

picture083

Data source: sản phẩm, Field from source: soluong

Field: ID, Trong phần Value click Fx

picture084

Data source: Current Item, Field from source: TenSanPhamNhap,

return field as: Lookup Id (as Interger) OK Ok

picture085

Phía dưới If đặt con trỏ vào Insert go-to action with…vào Action chọn Go to stage, tương tự trong phần Else

picture087

Click vào Stage để thêm Stage 2

picture088

Click vào Stage 1 sửa lại thành Tinh Nhap, Stage 2 thành Cong Nhap

picture089

Stage Tinh nhap, trong if click go to chọn Cong Nhap

picture091

trong else click go to chọn End of Workflow

picture093

Đặt con trỏ phía dưới stage cong nhap vào action chọn Update list Item

picture094

Click this list

picture095

Chọn List sản phẩm, ấn add

picture096

Set this field: Soluong, ấn fx

picture097

Data source: Workflow variables and parameters, Field from source: Tinh Nhap Ok

picture098

OK

picture099

Tiếp tục ấn add

picture100

Set this field: Gia, ấn Fx

picture101

Data source: Current item, Field from source: Gianhap Ok

picture102

OK

picture103

Field: chọn ID, click Fx trong phần Value

picture106

Data source: Current Item,

Field from source: Tensanphamnhap,

Return field as: Lookup id (as Interger) Ok Ok

picture107

Trong stage Cong nhap đặt con trỏ dưới Insert go-to actions with.. vào action chọn Go to stage

picture110

Click gog to chọn End of Workflow.

picture112

Chọn Workflow Settings

picture113

Check vào các checkbox như trong hình, chọn Publish, hoàn tất việc tạo workflow

picture114

B6. Thiết kế form phiếu nhập

B6. Thiết kế form phiếu nhập, Mở Infopath vào Tab File\New chọn Sharepoint list Design Form

picture115

Sharepoint site: http://internal.nhatnghe.local/QLTK next

picture116

Chọn List phiếu nhập next

picture117

Check vào checkbox manage multiple list items with this form next

picture118

Xóa bỏ dòng Attachments

picture119

Phải chuột vào Repeating Section properties

picture120

Check vào Allow users to insert and delete the sections Ok

picture121

Vào Tab Data Data Connections

picture122

Ấn Add

picture123

Chọn option Receive data next

picture124

Chọn option Sharepoint library or list next

picture125

Nhập vào site http://internal.nhatnghe.local/QLTK next

picture126

Chọn phiếu nhập next

picture127

Chọn ID next
picture128

Check vào Store a copy of the data in the form template next

picture129

Nhập name: Phiếu nhập Finish Close

picture130

Phải chuột field MaPhieuNhap chọn textbox properties…

picture132

Default Value ấn Fx

picture133

Formula: nhập Concat(“ Phieu Nhap – “, ấn Insert Function

picture134

chọn max OK

picture135

Chọn Double click to Insert field

picture136

Chọn Show advanced view

picture137

Trong Fields chọn Phiếu nhập chọn ID Ok

picture138

OK

picture139

OK

picture140

Vào Tab File chọn Publish Sharepoint list. Thiết kế xong form phiếu nhập

picture141

B7. Tạo list phiếu xuất, tạo column phiếu xuất.

B7. Tạo list phiếu xuất, tạo column phiếu xuất. Trở về site Quản lý tồn kho vào settings chọn Add an app

picture001

Chọn custom List

picture002

Nhập Name: PhieuXuat Create

picture003

Chọn Phiếu Xuất vừa tạo

picture004

Chọn Create Column.

picture005

Column Name: TenSanPhamXuat, chọn option Lookup

picture006

Get Information from: Sản Phẩm

In this column: Tên Sản Phẩm, check thêm Soluong Ok

picture005

Tiếp tục chọn Create Colomn

picture009

Column name: SluongXuat, chọn option Number

picture010

trong phần Column validation kiểm tra Sluongxuat>=0 Ok

picture003

Tiếp tục tạo column Giaxuat, chọn option currency

picture013

Currency format: Vietnam đồng

picture014

Kiểm tra Giaxuat >= 0 -> Ok. Tạo Column xong

picture004

Chọn list PhieuXuat vào tab list List settings

picture015

Chọn List name, description and navigation

picture016

Đổi name: Phiếu Xuất save

picture017

Trong phần column chọn Title

picture018

Đổi column name: MaPXuat

picture019

Cũng trong Column chọn TenSanPhamXuat:Soluong

picture006

Đổi Column name : SoluongTon ok

picture007

B8. Tạo workflow sản phẩm xuất.

B8. Tạo workflow sản phẩm xuất. Chọn List phiếu xuất vào Tab List chọn Create a workflow in sharepoint designer Allow

picture020

Name: San Pham Xuat, Platform Type: Sharepoint 2013 Workflow Ok

picture022

Đặt con trỏ phía dưới Stage 1 vào action chọn Do calculation

picture023

Click vào Value đầu tiên

picture024

Chọn Fx

picture025

Data source: Sản phẩm, Field from source: soluong, Field chọn ID, Value ấn Fx

picture026

Data source: Current Item, Field from source: TenSanPhamXuat,

Return fields as: Lookup Id(as Interger) Ok

picture027

Ok

picture028

Chọn Minus, click vào Value thứ 2

picture029

Ấn Fx

picture030

Data source: Current Item; Field from source: SluongXuat Ok

picture031

Output to chọn Create a new variable

picture032

Name: Sluongcon; Type: Number Ok

picture033

Đặt con trỏ trong phần Transition to stage vào action chọn If any value equals value

picture034

Click vào value đầu tiên

picture035

Click Fx

picture036

Data source: Workflow variables and parameters; Field from source: variable:Sluongcon

picture037

Chọn Is greater than or equal to 0

picture038

Đặt con trỏ phía dưới If vào Action chọn Goto Stage, tương tự cho Else

picture040

tương tự cho Else, vào Stage add thêm Stage 2

picture041

Chọn Stage 1 đổi thành Tinh Xuat

picture042

Đổi stage 2 thành Tru Sp

picture043

Trong If của Tinh xuat chọn Goto Tru Sp

picture045

Đặt con trỏ phía dưới Stage Tru Sp vào Action chọn Update List item

picture048

Click vào this list

picture049

List: sản Phẩm, ấn add

picture050

Set this field: Soluongn ấn Fx

picture051

Data source: Workflow variables and parameters,

Field from source:Variable Sluongcon Ok

picture052

Ok

picture053

Field: ID, Value: ấn Fx

picture054

Data source: Current Item, Field from source: TenSanPhamxuat,

Return field as: Lookup Id(as Interger) Ok

picture055

Ok

picture056

Đặt con trỏ phía dưới Transition to stage

picture057

Vào Action chọn Goto a stage

picture058

Chọn End Of Workflow

picture059

Vào Stage add thêm stage 3, đổi tên thành Xuat het, đặt con trỏ phía dưới Xuat het vào action chọn Set Field in Current Item

picture008

Click vào Field

picture009

Chọn SluongXuat, click vào Value

picture010

Click vào Fx

picture011

Data source: Sản Phẩm, Field from source:Soluong, Field: ID, value ấn Fx

picture012

Data source: Current Item, Field from source: TenSanPhamXuat,

Return field as: Lookup Id(as Interger) Ok

picture013

Click Ok

picture014

Đặt con trỏ phía dưới Set Sluongxuat, vào Action chọn Update List Item

picture015

Click vào this List

picture016

List: sản Phẩm, ấn Add

picture017

Set this field: Soluong, to this value: 0 Ok. Field: ID, Value ấn Fx

picture018

Data source: Current Item, Field from source: TenSanPhamXuat,

Return field as: Lookup Id(asInterger) Ok

picture019

OK

picture020

Đặt con trỏ phía dưới Transition vào Action chọn Go to Stage

picture021

Click Go to a Stage

picture022

Chọn End of Workflow

picture023

Trong phần Else của Stage Tinh Xuat chọn Go to Xuat Het

picture024

Chọn Workflow setting check vào các checkbox như trong hình chọn Publish. Tạo Workflow xong.

picture062

B9. Thiết Kế Form Phiếu Xuất.

B9. Thiết Kế Form Phiếu Xuất. Infopath designer, New\Sharepoint list Design form

picture001

Nhập vào site http://internal.nhatnghe.local/QLTK Next

picture002

Chọn list Phiếu Xuất Next

picture003

Check vào manage multiple list items with this form

picture004

Xóa dòng Attachment

picture005

Thiết kế form như trong hình. Vào Tab Data chọn Connections

picture006

Ấn Add

picture007

Chọn option Receive data Next

picture008

Chọn Option Sharepoint library or list Next

picture009

Nhập vào site: http://internal.nhatnghe.local/QLTK –> Next

picture010

Chọn List Phiếu Xuất Next

picture011

Check vào ID Next

picture012

Check vào Store a copy or the data in the form template

picture013

Nhập vào tên phiếu Xuất, check vào Automatic receive… Finish Close

picture014

Phải chuột vào Field MaPXuat chọn textbox properties …

picture016

Click vào Fx

picture017

Nhập Concat(“Phieu Xuat –“, ấn Insert Function chọn Max, click vào Double click to insert field

picture018

Chọn Show advanced view

picture019

Fields chọn Phiếu Xuất, Chọn ID OK

picture020

Mã phiếu xuất tự động tăng OK

picture021

Ok

picture022

Phải chuột vào Repeating Section Properties ….

picture023

Check vào Allow users to insert and delete the section OK

picture024

Thiết kế Phiếu Xuất xong vào tab File chọn Publish Ok

picture025

B10. Tạo View.

B10. Tạo View. Trở về site Internal.nhatnghe.local/QLTK chọn List phiếu xuất, vào Tab List Create view.

picture001

Chọn all items

picture002

View Name: groupbyPhieuXuat

picture003

Chọn các checkbox như trong hình

picture004

Trong phần Group by chọn Group by theo Created và MaPXuat

picture005

Trong phần Totals chọn Sum Giaxuat Ok

picture006

Tương tự chọn List Phiếu Nhập, vào Tab List Create View

picture008

Chọn All Items

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

View name: Groupbyphieunhap và các checkbox như trong hình

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Trong phần Group by chọn group by theo Created và MaPhieuNhap

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

Trong phần Totals chọn Sum theo gia nhap Ok. Tạo View xong.

ung-dung-quan-ly-ban-hang-voi-sharepoint-2016

B11 Test.

B11 Test. Tiến hành tạo phiếu nhập và Phiếu xuất kiểm tra xem có cộng và trừ số lượng trong list sản phẩm không?

Mr CTL – labs.ctl.vn

Lab Sharepoint 2016 Phần 16

Leave a Reply