Sfoglia il codice sorgente

1. 变更令,从云端获取的变更令可删除,且删除前同步删除云端
2. 清单汇总bug

MaiXinRong 7 anni fa
parent
commit
6acf466c82

+ 24 - 3
DataModules/BGLDm.pas

@@ -127,6 +127,7 @@ type
     procedure UpdateBGLExecutionRate(ABGLID: Integer);
     procedure ApplyBGL(ABGLInfo: TBGLSelectInfo); overload;
 
+    function DeleteWeb(AWebID: Integer): Boolean;
     procedure DeleteBGBills(ABGID: Integer);
 
     function CheckSameB_Code(ABGID: Integer; const AB_Code: string): Boolean;
@@ -161,7 +162,8 @@ type
 implementation
 
 uses
-  ZhAPI, Math, ProjectData, BillsDm, Variants, UtilMethods, superobject;
+  ZhAPI, Math, ProjectData, BillsDm, Variants, UtilMethods, superobject,
+  PHPWebDm, Forms, Controls;
 
 {$R *.dfm}
 
@@ -508,8 +510,10 @@ procedure TBGLData.cdsBGLViewBeforeDelete(DataSet: TDataSet);
 begin
   if CheckBGLUsed(cdsBGLViewID.AsInteger) then
     raise Exception.Create('变更令下变更清单已被应用到清单,不可删除!');
-  if cdsBGLViewIsCloud.AsBoolean then
-    raise Exception.Create('云端获取的变更令不允许删除!');
+  //if cdsBGLViewIsCloud.AsBoolean then
+    //raise Exception.Create('云端获取的变更令不允许删除!');
+  if cdsBGLViewIsCloud.AsBoolean and not DeleteWeb(cdsBGLViewWebID.AsInteger) then
+    raise Exception.Create('同步删除云端数据失败,请重试');
   DeleteBGBills(cdsBGLViewID.AsInteger);
 end;
 
@@ -786,4 +790,21 @@ begin
     FAfterCurrentBGLChanged;
 end;
 
+function TBGLData.DeleteWeb(AWebID: Integer): Boolean;
+var
+  sgs: TStrings;
+  sUrl, sInfo: string;
+begin
+  Screen.Cursor := crHourGlass;
+  sgs := TStringList.Create;
+  try
+    sgs.Add(Format('cid=%d', [AWebID]));
+    sUrl := PHPWeb.MeasureURL + 'change/delete';
+    Result := PHPWeb.UrlGet(sUrl, sgs, sInfo) = 1;
+  finally
+    sgs.Free;
+    Screen.Cursor := crDefault;
+  end;
+end;
+
 end.

+ 60 - 0
DataModules/BillsGatherDm.dfm

@@ -479,19 +479,79 @@ object BillsGatherData: TBillsGatherData
         FieldName = 'Quantity'
       end
       item
+        FieldName = 'PreDealQuantity'
+      end
+      item
+        FieldName = 'PreDealTotalPrice'
+      end
+      item
+        FieldName = 'PreQcQuantity'
+      end
+      item
+        FieldName = 'PreQcTotalPrice'
+      end
+      item
+        FieldName = 'PreGatherQuantity'
+      end
+      item
+        FieldName = 'PreGatherTotalPrice'
+      end
+      item
+        FieldName = 'CurDealQuantity'
+      end
+      item
+        FieldName = 'CurDealTotalPrice'
+      end
+      item
+        FieldName = 'CurQcQuantity'
+      end
+      item
+        FieldName = 'CurQcTotalPrice'
+      end
+      item
         FieldName = 'CurGatherQuantity'
       end
       item
+        FieldName = 'CurGatherTotalPrice'
+      end
+      item
         FieldName = 'EndDealQuantity'
       end
       item
+        FieldName = 'EndDealTotalPrice'
+      end
+      item
         FieldName = 'EndQcQuantity'
       end
       item
+        FieldName = 'EndQcTotalPrice'
+      end
+      item
         FieldName = 'EndGatherQuantity'
       end
       item
+        FieldName = 'EndGatherTotalPrice'
+      end
+      item
         FieldName = 'Percent'
+      end
+      item
+        FieldName = 'AddDealQuantity'
+      end
+      item
+        FieldName = 'AddDealTotalPrice'
+      end
+      item
+        FieldName = 'AddQcQuantity'
+      end
+      item
+        FieldName = 'AddQcTotalPrice'
+      end
+      item
+        FieldName = 'AddGatherQuantity'
+      end
+      item
+        FieldName = 'AddGatherTotalPrice'
       end>
     OnFilterRecord = sdvDetailGclBillsFilterRecord
     OnGetText = sdvGclBillsGetText

+ 4 - 1
DataModules/PHPWebDm.pas

@@ -914,7 +914,10 @@ begin
         vJ := SO(Utf8ToAnsi(ssResponse.DataString));
         if SameText(vJ['status'].AsString, 'true') then
         begin
-          AResult := vJ['info'].AsString;
+          if Assigned(vJ['info']) then
+            AResult := vJ['info'].AsString
+          else
+            AResult := vJ['msg'].AsString;
           Result := 1;
         end
         else if SameText(vJ['status'].AsString, 'false') then

+ 1 - 0
Frames/BGLFme.pas

@@ -279,6 +279,7 @@ begin
     else if sInfo <> '' then
       WarningMessage(sInfo);
   finally
+    sgs.Free;
     Screen.Cursor := crDefault;
   end;
 end;

+ 1 - 1
Units/GclBillsGatherModel.pas

@@ -130,7 +130,7 @@ type
     property AddDealQuantity: Double read FAddDealQuantity write FAddDealQuantity;
     property AddDealTotalPrice: Double read FAddDealTotalPrice write FAddDealTotalPrice;
     property AddQcQuantity: Double read FAddQcQuantity write FAddQcQuantity;
-    property AddQcTotalPrice: Double read FAddQcTotalPrice write FAddQcQuantity;
+    property AddQcTotalPrice: Double read FAddQcTotalPrice write FAddQcTotalPrice;
     property AddGatherQuantity: Double read FAddGatherQuantity write FAddGatherQuantity;
     property AddGatherTotalPrice: Double read FAddGatherTotalPrice write FAddGatherTotalPrice;
 

+ 1 - 0
Units/mPegFilter.pas

@@ -233,6 +233,7 @@ begin
   Result := AStr;
   Result := StringReplace(Result, 'K', 'k', [rfReplaceAll]);
   Result := StringReplace(Result, '£«', '+', [rfReplaceAll]);
+  Result := StringReplace(Result, '£­', '-', [rfReplaceAll]);
   Result := StringReplace(Result, '¡«', '~', [rfReplaceAll]);
   Result := StringReplace(Result, ' ', '', [rfReplaceAll]);
 end;