package com.jwipc.finance.controller;

import com.jwipc.security.LoginUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import static com.jwipc.finance.constant.ModuleConst.MODULE_ROOT;

/**
 * @author Al
 * @create 2023-07-03 14:38
 */
@Controller
@RequestMapping(MODULE_ROOT + "/invoice/detail")
@RequiredArgsConstructor
public class InvoiceDetailPageController {
    /**
     * 材料开票申请单首页
     *
     * @param model model
     * @return 页面
     */
    @GetMapping("/index")
    public String materialIndex(Model model){
        model.addAttribute("orderType", 1);
        if(!LoginUtil.isSupplier()){
            model.addAttribute("isSupplier", 0);
        }else {
            model.addAttribute("isSupplier", 1);
        }
        return MODULE_ROOT + "/receive/invoiceDetail";
    }

    @GetMapping("/updateDeductionStatusPage")
    public String updateRatioPage(String ids, Model model){
        model.addAttribute("ids",ids);
        return MODULE_ROOT + "/receive/update_deductionStatus_page";
    }
}
