Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

hy 6 years ago
parent
commit
5266c3488f

+ 3 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java

@@ -353,7 +353,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         map.put("custuu", companyDTO.getUu());
         map.put("custuu", companyDTO.getUu());
         map.put("apcheck", 1);
         map.put("apcheck", 1);
         Map<String, String> params = new HashMap<String, String>();
         Map<String, String> params = new HashMap<String, String>();
-        params.put("data", JsonUtils.toJsonString(map));
+        List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
+        data.add(map);
+        params.put("data", JsonUtils.toJsonString(data));
         Response response = HttpUtil.sendPostRequest(b2bUrl + "/erp/vendor/apcheck?access_id=" + companyDTO.getUu(), params, true, companyDTO.getAccessKey());
         Response response = HttpUtil.sendPostRequest(b2bUrl + "/erp/vendor/apcheck?access_id=" + companyDTO.getUu(), params, true, companyDTO.getAccessKey());
         if (response.getStatusCode() == 200){
         if (response.getStatusCode() == 200){
             LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);
             LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -100,7 +100,7 @@
         pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
         pr_whname, pr_zxbzs, pr_leadtime, pr_brand, pr_standardprice, pr_purcprice, pr_saleprice,
         pr_vendid, pr_vendcode, pr_vendname, pr_status,
         pr_vendid, pr_vendcode, pr_vendname, pr_status,
         pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
         pr_statuscode, companyId, updaterId, updateTime, pr_text1, pr_text2, pr_text3,
-        pr_text4, pr_text5,pr_remark
+        pr_text4, pr_text5,pr_remark,b2bStatus
     </sql>
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
         select
         select

+ 31 - 0
applications/document/document-server/src/test/java/com/usoftchina/saas/document/service/VendorTest.java

@@ -2,16 +2,25 @@ package com.usoftchina.saas.document.service;
 
 
 
 
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.account.dto.CompanyDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.DocumentApplication;
 import com.usoftchina.saas.document.DocumentApplication;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.utils.JsonUtils;
+import com.usoftchina.saas.utils.http.HttpUtil;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @RunWith(SpringJUnit4ClassRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = DocumentApplication.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = DocumentApplication.class)
@@ -21,6 +30,8 @@ public class VendorTest {
     @Autowired
     @Autowired
     private VendorService vendorService;
     private VendorService vendorService;
 
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(VendorTest.class);
+
     @Test
     @Test
     public void testSelectAll(){
     public void testSelectAll(){
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(null, null);
@@ -29,4 +40,24 @@ public class VendorTest {
         System.out.println("vendType: " + vendorList.getList().get(0).getVe_type());
         System.out.println("vendType: " + vendorList.getList().get(0).getVe_type());
         System.out.println("vendBeginDate: " + vendorList.getList().get(0).getVe_status());
         System.out.println("vendBeginDate: " + vendorList.getList().get(0).getVe_status());
     }
     }
+
+    @Test
+    public void enableApCheck() throws Exception {
+        Map<String, Object> map = new HashMap<String, Object>();
+        String ve_uu = "10050735";
+        map.put("venduu", ve_uu);
+        map.put("custuu", 10050742);
+        map.put("apcheck", 1);
+        Map<String, String> params = new HashMap<String, String>();
+        List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
+        data.add(map);
+        params.put("data", JsonUtils.toJsonString(data));
+        HttpUtil.Response response = HttpUtil.sendPostRequest("http://test-b2b.uuzcc.cn" + "/erp/vendor/apcheck?access_id=" + 10050735, params, true, "94be4fe301c64a728a4bbf37bd348eab");
+        if (response.getStatusCode() == 200){
+            LOGGER.info("供应商UU={},启用B2B对账成功!", ve_uu);
+        }else {
+            LOGGER.info("供应商UU={},启用B2B对账失败!,原因={}", ve_uu, response.getResponseText());
+        }
+    }
+
 }
 }

+ 20 - 1
base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java

@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -188,7 +189,25 @@ public class FileController {
     }
     }
 
 
     @ApiOperation(value = "查看文件信息")
     @ApiOperation(value = "查看文件信息")
-    @GetMapping(value = "/info")
+    @GetMapping(value = "/info", params = "ids")
+    public Result<FileInfoDTO> getFileInfoList(String ids) {
+        if (StringUtils.isEmpty(ids)){
+            throw new BizException(ExceptionCode.ILLEGAL_ARGUMENTS);
+        }
+        List<FileInfo> fileInfoList = new ArrayList<>();
+        String[] idArr = ids.split(";");
+        for (int i = 0; i < idArr.length; i++) {
+            FileInfo info = fileService.findByPrimaryKey(Long.parseLong(idArr[i]));
+            fileInfoList.add(info);
+        }
+        if (!CollectionUtils.isEmpty(fileInfoList)) {
+            return Result.success(BeanMapper.mapList(fileInfoList, FileInfoDTO.class));
+        }
+        return Result.error(ExceptionCode.FILE_NOT_EXISTS);
+    }
+
+    @ApiOperation(value = "查看文件信息")
+    @GetMapping(value = "/info", params = "path")
     public Result<FileInfoDTO> getFileInfo(@RequestParam("path") String path) {
     public Result<FileInfoDTO> getFileInfo(@RequestParam("path") String path) {
         FileInfo info = fileService.findByFullPath(path);
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {
         if (null != info) {

+ 7 - 1
base-servers/file/file-server/src/main/resources/application.yml

@@ -39,6 +39,12 @@ spring:
   jackson:
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
     time-zone: GMT+8
+  servlet:
+    multipart:
+      enabled: true
+      #20971520 ->  20M
+      max-file-size: 20971520
+      max-request-size: 20971520
 eureka:
 eureka:
   instance:
   instance:
     leaseRenewalIntervalInSeconds: 10
     leaseRenewalIntervalInSeconds: 10
@@ -51,7 +57,7 @@ eureka:
   client:
   client:
     registryFetchIntervalSeconds: 5
     registryFetchIntervalSeconds: 5
     serviceUrl:
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@10.1.81.61:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
 server:
 server:
   port: 8640
   port: 8640
   tomcat:
   tomcat:

+ 4 - 7
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -120,13 +120,10 @@ Ext.define('saas.view.document.customer.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                         return Ext.util.Format.number(v, '0');
                     }
                     }
                 }, {
                 }, {
-                    text: '应收余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 'cu_leftamount',
-                    width: 120,
-                    renderer : function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 'cu_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                 }, {
                     text : "业务员", 
                     text : "业务员", 
                     dataIndex : "cu_sellername",
                     dataIndex : "cu_sellername",

+ 0 - 13
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -176,19 +176,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 renderer: function(v, m, r) {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 },
-            }, {
-                xtype: 'textfield',
-                name: "cu_leftamount",
-                fieldLabel: "应收余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
             }, {
                 xtype: "numberfield",
                 xtype: "numberfield",
                 hideTrigger: true,
                 hideTrigger: true,

+ 4 - 7
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -111,13 +111,10 @@ Ext.define('saas.view.document.vendor.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                         return Ext.util.Format.number(v, '0');
                     }
                     }
                 }, {
                 }, {
-                    text: '应付余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 've_leftamount',
-                    width: 120,
-                    renderer: function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 've_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                 }, {
                     text: "备注",
                     text: "备注",
                     dataIndex: "ve_remark",
                     dataIndex: "ve_remark",

+ 0 - 14
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -183,20 +183,6 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 renderer: function(v, m, r) {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
                 },
-            }, {
-                xtype: "numberfield",
-                name: "ve_leftamount",
-                fieldLabel: "应付余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                ignore: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
             }, {
                 xtype: "numberfield",
                 xtype: "numberfield",
                 hideTrigger: true,
                 hideTrigger: true,

+ 34 - 19
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -927,38 +927,53 @@ Ext.define('saas.view.money.verification.FormPanel', {
 
 
                 defaultConditions: {
                 defaultConditions: {
                     receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
                     receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'收款单\') or ' +
+                              '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                                            'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
 
                         'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                         'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or '+
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     ],
                     prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
                     prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'付款单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
 
 
 
                         'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
                         'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        ' and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     ],
                     receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                     receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-
-                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
+
+                        'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     ],
                     receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
                     receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     ],
                     payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
                     payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        ' and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        ' and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ]
                     ]
                 }
                 }
             },
             },

+ 3 - 1
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -216,8 +216,10 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             });
             });
             var fieldLabel = field.fieldLabel || field.name;
             var fieldLabel = field.fieldLabel || field.name;
             var fieldValue = viewModel.get(fieldName);
             var fieldValue = viewModel.get(fieldName);
+            if(Ext.isDate(fieldValue)) {
+                fieldValue = Ext.Date.format(fieldValue, 'Y-m-d');
+            }
             fields[fieldName] = fieldValue;
             fields[fieldName] = fieldValue;
-            
             if(!fieldValue && nullFields.indexOf(fieldLabel) == -1) {
             if(!fieldValue && nullFields.indexOf(fieldLabel) == -1) {
                 nullFields.push(fieldLabel);
                 nullFields.push(fieldLabel);
             }
             }