浏览代码

发票管理财务部操作收款功能

user5 4 年之前
父节点
当前提交
61cfa377d6

+ 11 - 1
src/main/java/com/jeeplus/modules/workinvoice/dao/WorkInvoiceDao.java

@@ -30,6 +30,16 @@ public interface WorkInvoiceDao extends CrudDao<WorkInvoice> {
 	 */
 	 */
 	public int updateProcessInstanceId(WorkInvoice workInvoice);
 	public int updateProcessInstanceId(WorkInvoice workInvoice);
 
 
+	/**
+	 * 删除作废操作
+	 * @param workInvoice
+	 */
 	void cancellationDelete(WorkInvoice workInvoice);
 	void cancellationDelete(WorkInvoice workInvoice);
-	
+
+	/**
+	 * 财务收款操作
+	 * @param workInvoice
+	 */
+	void receiptMoney(WorkInvoice workInvoice);
+
 }
 }

+ 27 - 0
src/main/java/com/jeeplus/modules/workinvoice/entity/WorkInvoice.java

@@ -62,6 +62,9 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	private String cancleReason; //作废原因
 	private String cancleReason; //作废原因
 	private String companyId; //提交人的公司编号
 	private String companyId; //提交人的公司编号
 	private String officeId;
 	private String officeId;
+	private String officeName;
+	private String submitterId;		// 发票登记人id
+	private String submitterName;		// 发票登记人名称
 	private String ext;//1总公司-上级公司0分公司-本公司
 	private String ext;//1总公司-上级公司0分公司-本公司
 	private String contractDate;
 	private String contractDate;
 	private String province; //省份
 	private String province; //省份
@@ -483,4 +486,28 @@ public class WorkInvoice extends ActEntity<WorkInvoice> {
 	public void setCancellationRemark(String cancellationRemark) {
 	public void setCancellationRemark(String cancellationRemark) {
 		this.cancellationRemark = cancellationRemark;
 		this.cancellationRemark = cancellationRemark;
 	}
 	}
+
+	public String getOfficeName() {
+		return officeName;
+	}
+
+	public void setOfficeName(String officeName) {
+		this.officeName = officeName;
+	}
+
+	public String getSubmitterId() {
+		return submitterId;
+	}
+
+	public void setSubmitterId(String submitterId) {
+		this.submitterId = submitterId;
+	}
+
+	public String getSubmitterName() {
+		return submitterName;
+	}
+
+	public void setSubmitterName(String submitterName) {
+		this.submitterName = submitterName;
+	}
 }
 }

+ 13 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -507,6 +507,19 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 		}*/
 		}*/
 	}
 	}
 
 
+	/**
+	 * 财务收款操作
+	 * @param workInvoice
+	 */
+	@Transactional(readOnly = false)
+	public void receiptMoney(WorkInvoice workInvoice) {
+		workInvoice.preUpdate();
+		dao.receiptMoney(workInvoice);
+		/*for (WorkInvoiceDetail workAccount : workInvoice.getWorkAccountList()){
+			workInvoiceDetailDao.delete(workAccount);
+		}*/
+	}
+
 	public Page<WorkClientInfo> findPageByclient(Page<WorkClientInfo> page, WorkClientInfo client) {
 	public Page<WorkClientInfo> findPageByclient(Page<WorkClientInfo> page, WorkClientInfo client) {
 		client.setPage(page);
 		client.setPage(page);
 		page.setList(dao.findListByclient(client));
 		page.setList(dao.findListByclient(client));

+ 10 - 0
src/main/java/com/jeeplus/modules/workinvoice/web/WorkInvoiceController.java

@@ -146,6 +146,7 @@ public class WorkInvoiceController extends BaseController {
 			}
 			}
 		}
 		}
 		model.addAttribute("page", page);
 		model.addAttribute("page", page);
+		model.addAttribute("workInvoiceShow", workInvoice);
 		return "modules/workinvoice/workInvoiceList";
 		return "modules/workinvoice/workInvoiceList";
 	}
 	}
 	/**
 	/**
@@ -515,6 +516,15 @@ public class WorkInvoiceController extends BaseController {
 		addMessage(redirectAttributes, "作废发票管理成功");
 		addMessage(redirectAttributes, "作废发票管理成功");
 		return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
 		return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
 	}
 	}
+	/**
+	 * 财务收款状态更改方法
+	 */
+	@RequestMapping(value = "receiptMoney")
+	public String receiptMoney(WorkInvoice workInvoice, RedirectAttributes redirectAttributes) {
+		workInvoiceService.receiptMoney(workInvoice);
+		addMessage(redirectAttributes, "作废发票管理成功");
+		return "redirect:"+Global.getAdminPath()+"/workinvoice/workInvoice/?repage";
+	}
 	
 	
 	/**
 	/**
 	 * 批量删除开票管理
 	 * 批量删除开票管理

+ 26 - 13
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -124,15 +124,18 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
 			</if>
-			<if test="office != null and office.name != null and office.name != ''">
-				AND so.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{office.name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{office.name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{office.name},'%')</if>
+			<if test="officeId != null and officeId != ''">
+				AND so.id  = #{officeId}
 			</if>
 			</if>
 			<if test="money != null and money != ''">
 			<if test="money != null and money != ''">
 				AND a.money = #{money}
 				AND a.money = #{money}
 			</if>
 			</if>
+			<if test="submitterId != null and submitterId != ''">
+				AND a.create_by = #{submitterId}
+			</if>
+			<if test="receiptMoney != null and receiptMoney != ''">
+				AND a.receipt_money = #{receiptMoney}
+			</if>
 			<if test="invoiceType != null and invoiceType != ''">
 			<if test="invoiceType != null and invoiceType != ''">
 				AND a.invoice_type = #{invoiceType}
 				AND a.invoice_type = #{invoiceType}
 			</if>
 			</if>
@@ -190,9 +193,7 @@
 		<if test="project != null">
 		<if test="project != null">
 			LEFT JOIN rural_project_records p ON  p.id = a.project_id
 			LEFT JOIN rural_project_records p ON  p.id = a.project_id
 		</if>
 		</if>
-		<if test="office != null and office.name != null and office.name != ''">
-			LEFT join sys_office so on so.id = a.office_id
-		</if>
+		LEFT join sys_office so on so.id = a.office_id
 		<where>
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
 			a.del_flag = #{DEL_FLAG_NORMAL}
 			<if test="number != null and number != ''">
 			<if test="number != null and number != ''">
@@ -228,11 +229,14 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
 			</if>
-			<if test="office != null and office.name != null and office.name != ''">
-				AND so.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{office.name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{office.name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{office.name},'%')</if>
+			<if test="officeId != null and officeId != ''">
+				AND so.id  = #{officeId}
+			</if>
+			<if test="submitterId != null and submitterId != ''">
+				AND a.create_by = #{submitterId}
+			</if>
+			<if test="receiptMoney != null and receiptMoney != ''">
+				AND a.receipt_money = #{receiptMoney}
 			</if>
 			</if>
 			<if test="money != null and money != ''">
 			<if test="money != null and money != ''">
 				AND a.money = #{money}
 				AND a.money = #{money}
@@ -450,6 +454,15 @@
 			invoice_state=5
 			invoice_state=5
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</update>
+
+	<update id="receiptMoney">
+		UPDATE work_invoice SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			receipt_money_date= now(),
+			receipt_money = 1
+		WHERE id = #{id}
+	</update>
 	
 	
 	
 	
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->

+ 58 - 5
src/main/webapp/webpage/modules/workinvoice/workInvoiceList.jsp

@@ -239,7 +239,7 @@
 					</div>
 					</div>
 					<div id="moresees" class="lw9" style="clear:both;display:none;">
 					<div id="moresees" class="lw9" style="clear:both;display:none;">
 						<div class="layui-item query athird">
 						<div class="layui-item query athird">
-							<label class="layui-form-label">创建日期:</label>
+							<label class="layui-form-label">开票日期:</label>
 							<div class="layui-input-block">
 							<div class="layui-input-block">
 								<input id="beginContractDate" name="beginContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
 								<input id="beginContractDate" name="beginContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
 									   value="<fmt:formatDate value="${workInvoice.beginContractDate}" pattern="yyyy-MM-dd"/>"/>
 									   value="<fmt:formatDate value="${workInvoice.beginContractDate}" pattern="yyyy-MM-dd"/>"/>
@@ -257,18 +257,45 @@
 							</div>
 							</div>
 						</div>
 						</div>
 						<div class="layui-item query athird">
 						<div class="layui-item query athird">
-							<label class="layui-form-label">所属部门:</label>
-							<div class="layui-input-block">
-								<form:input path="office.name" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+							<label class="layui-form-label">经办人部门:</label>
+							<div class="layui-input-block with-icon">
+								<sys:treeselect id="officeId" name="officeId" value="${workInvoice.officeId}" labelName="officeName" labelValue="${workInvoice.officeName}"
+												title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">报销人:</label>
+							<div class="layui-input-block with-icon">
+								<sys:treeselect id="submitterId" name="submitterId" value="${workInvoice.submitterId}" labelName="submitterName" labelValue="${workInvoice.submitterName}"
+												title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
 							</div>
 							</div>
 						</div>
 						</div>
 						<div class="layui-item query athird">
 						<div class="layui-item query athird">
-							<label class="layui-form-label">实际开票单位:</label>
+							<label class="layui-form-label">开票单位:</label>
 							<div class="layui-input-block with-icon">
 							<div class="layui-input-block with-icon">
 								<form:input path="client.name" htmlEscape="false"  class=" form-control layui-input"/>
 								<form:input path="client.name" htmlEscape="false"  class=" form-control layui-input"/>
 							</div>
 							</div>
 						</div>
 						</div>
 						<div class="layui-item query athird">
 						<div class="layui-item query athird">
+							<label class="layui-form-label">是否收款:</label>
+							<div class="layui-input-block with-icon">
+								<select id="receiptMoney" name="receiptMoney" class="form-control simple-select">
+									<option value=""></option>
+									<option value="0" <c:if test="${workInvoiceShow.receiptMoney=='0'}">selected</c:if>>否</option>
+									<option value="1" <c:if test="${workInvoiceShow.receiptMoney=='1'}">selected</c:if>>是</option>
+								</select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">发票类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="invoiceType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('invoice_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
 							<label class="layui-form-label">状态:</label>
 							<label class="layui-form-label">状态:</label>
 							<div class="layui-input-block with-icon">
 							<div class="layui-input-block with-icon">
 								<form:select path="invoiceState" class="form-control simple-select">
 								<form:select path="invoiceState" class="form-control simple-select">
@@ -277,6 +304,24 @@
 								</form:select>
 								</form:select>
 							</div>
 							</div>
 						</div>
 						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">收款类型:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="chargeType" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('receipt_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">开票内容:</label>
+							<div class="layui-input-block with-icon">
+								<form:select path="billingContent" class="form-control simple-select">
+									<form:option value="" label=""/>
+									<form:options items="${fns:getMainDictList('billing_content')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
 					</div>
 					</div>
 				</form:form>
 				</form:form>
 			</div>
 			</div>
@@ -391,6 +436,10 @@
                             xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoice/workInvoice/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
                             xml += "<a href=\"javascript:void(0)\" onclick=\"contractOpenDialogre('变更发票管理', '${ctx}/workinvoice/workInvoice/alterForm?id="+ d.id +"','95%','95%')\" class=\"op-btn op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
                         }*/
                         }*/
 
 
+						if(d.financeFlag != undefined && d.financeFlag =="1")
+						{
+							xml += "<a href=\"${ctx}/workinvoice/workInvoice/receiptMoney?id=" + d.id + "\" onclick=\"return confirmx('确认该发票已收款吗?', this.href)\"   class=\"op-btn layui-btn\"><i class=\"fa fa-edit\"></i> 收款</a>";
+						}
 						if(d.cancellationFlag != undefined && d.cancellationFlag =="1")
 						if(d.cancellationFlag != undefined && d.cancellationFlag =="1")
 						{
 						{
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoice/workInvoice/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"op-btn op-btn-invalid\" ><i class=\"fa fa-trash-o\"></i> 作废</a>";
 							xml +="<a href=\"javascript:void(0)\" onclick=\"openDialogreplay('作废发票', '${ctx}/workinvoice/workInvoice/cancellationForm?id=" + d.id + "&tabId=3','95%','95%')\" class=\"op-btn op-btn-invalid\" ><i class=\"fa fa-trash-o\"></i> 作废</a>";
@@ -464,6 +513,10 @@
 							<c:when test="${workInvoice.invoiceState == 5 && workInvoice.cancellation == '1'}">"1"</c:when>
 							<c:when test="${workInvoice.invoiceState == 5 && workInvoice.cancellation == '1'}">"1"</c:when>
 					<c:otherwise>"0"</c:otherwise>
 					<c:otherwise>"0"</c:otherwise>
 					</c:choose>
 					</c:choose>
+					,"financeFlag":<c:choose>
+							<c:when test="${workInvoice.invoiceState == 5 && workInvoice.cancellation == '1' && workInvoice.receiptMoney == '否'}">"1"</c:when>
+					<c:otherwise>"0"</c:otherwise>
+					</c:choose>
 					,"adminFlag":<c:choose>
 					,"adminFlag":<c:choose>
 							<c:when test="${workInvoice.invoiceState == 5 && workInvoice.adminFlag == '1'}">"1"</c:when>
 							<c:when test="${workInvoice.invoiceState == 5 && workInvoice.adminFlag == '1'}">"1"</c:when>
 					<c:otherwise>"0"</c:otherwise>
 					<c:otherwise>"0"</c:otherwise>