10. August 2009 00:32
10. August 2009 09:16
10. August 2009 09:17
10. August 2009 09:22
10. August 2009 09:24
10. August 2009 10:24
McClane hat geschrieben:Und wenn du den Line Amount einfach im Report auf Null setzt?
10. August 2009 11:01
Natalie hat geschrieben:Damit würde in der Angebotsstatistik die Alternativposition voll zählen - deswegen die Alternative mit Zeilenrabatt 100%.
10. August 2009 11:29
IF NOT OldSalesLine."Option Position" ...
11. August 2009 18:50
TotalAdjCostLCY := 0;
TempVATAmountLineRemainder.DELETEALL;
OldSalesLine.CalcVATAmountLines(QtyType,SalesHeader,OldSalesLine,TempVATAmountLine);
WITH SalesHeader DO BEGIN
GLSetup.GET;
SalesSetup.GET;
GetCurrency;
OldSalesLine.SETRANGE("Document Type","Document Type");
OldSalesLine.SETRANGE("Document No.","No.");
RoundingLineInserted := FALSE;
IF OldSalesLine.FINDSET THEN
REPEAT
IF NOT RoundingLineInserted THEN
SalesLine := OldSalesLine;
CASE QtyType OF
QtyType::General:
SalesLineQty := SalesLine.Quantity;
QtyType::Invoicing:
SalesLineQty := SalesLine."Qty. to Invoice";
QtyType::Shipping:
BEGIN
IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN
SalesLineQty := SalesLine."Return Qty. to Receive"
ELSE
SalesLineQty := SalesLine."Qty. to Ship";
END;
END;
DivideAmount(QtyType,SalesLineQty);
SalesLine.Quantity := SalesLineQty;
IF SalesLineQty <> 0 THEN BEGIN
IF (SalesLine.Amount <> 0) AND NOT RoundingLineInserted THEN
IF TotalSalesLine.Amount = 0 THEN
TotalSalesLine."VAT %" := SalesLine."VAT %"
ELSE
IF TotalSalesLine."VAT %" <> SalesLine."VAT %" THEN
TotalSalesLine."VAT %" := 0;
RoundAmount(SalesLineQty);
IF (QtyType IN [QtyType::General,QtyType::Invoicing]) AND
NOT InsertSalesLine AND CalcAdCostLCY
THEN BEGIN
AdjCostLCY := CostCalcMgt.CalcSalesLineCostLCY(SalesLine,QtyType);
// Ab hier editiert : CM
IF NOT OldSalesLine."Optional Position" THEN
// Bis hier editiert : CM
TotalAdjCostLCY := TotalAdjCostLCY + GetSalesLineAdjCostLCY(SalesLine,QtyType,AdjCostLCY);
END;
SalesLine := TempSalesLine;
END;
IF InsertSalesLine THEN BEGIN
NewSalesLine := SalesLine;
NewSalesLine.INSERT;
END;
IF RoundingLineInserted THEN
LastLineRetrieved := TRUE
ELSE BEGIN
LastLineRetrieved := OldSalesLine.NEXT = 0;
IF LastLineRetrieved AND SalesSetup."Invoice Rounding" THEN
InvoiceRounding(TRUE);
END;
UNTIL LastLineRetrieved;
END;
11. August 2009 21:29
TotalAdjCostLCY := 0;
TempVATAmountLineRemainder.DELETEALL;
OldSalesLine.CalcVATAmountLines(QtyType,SalesHeader,OldSalesLine,TempVATAmountLine);
WITH SalesHeader DO BEGIN
GLSetup.GET;
SalesSetup.GET;
GetCurrency;
OldSalesLine.SETRANGE("Document Type","Document Type");
OldSalesLine.SETRANGE("Document No.","No.");
RoundingLineInserted := FALSE;
IF OldSalesLine.FINDSET THEN
REPEAT
IF NOT RoundingLineInserted THEN
SalesLine := OldSalesLine;
CASE QtyType OF
QtyType::General:
SalesLineQty := SalesLine.Quantity;
QtyType::Invoicing:
SalesLineQty := SalesLine."Qty. to Invoice";
QtyType::Shipping:
BEGIN
IF "Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"] THEN
SalesLineQty := SalesLine."Return Qty. to Receive"
ELSE
SalesLineQty := SalesLine."Qty. to Ship";
END;
END;
DivideAmount(QtyType,SalesLineQty);
SalesLine.Quantity := SalesLineQty;
IF NOT OldSalesLine."Alternative Item Line" THEN BEGIN /////////
IF SalesLineQty <> 0 THEN BEGIN
IF (SalesLine.Amount <> 0) AND NOT RoundingLineInserted THEN
IF TotalSalesLine.Amount = 0 THEN
TotalSalesLine."VAT %" := SalesLine."VAT %"
ELSE
IF TotalSalesLine."VAT %" <> SalesLine."VAT %" THEN
TotalSalesLine."VAT %" := 0;
RoundAmount(SalesLineQty);
IF (QtyType IN [QtyType::General,QtyType::Invoicing]) AND
NOT InsertSalesLine AND CalcAdCostLCY
THEN BEGIN
AdjCostLCY := CostCalcMgt.CalcSalesLineCostLCY(SalesLine,QtyType);
TotalAdjCostLCY := TotalAdjCostLCY + GetSalesLineAdjCostLCY(SalesLine,QtyType,AdjCostLCY);
END;
SalesLine := TempSalesLine;
END; ////////////
END;
IF InsertSalesLine THEN BEGIN
NewSalesLine := SalesLine;
NewSalesLine.INSERT;
END;
IF RoundingLineInserted THEN
LastLineRetrieved := TRUE
ELSE BEGIN
LastLineRetrieved := OldSalesLine.NEXT = 0;
IF LastLineRetrieved AND SalesSetup."Invoice Rounding" THEN
InvoiceRounding(TRUE);
END;
UNTIL LastLineRetrieved;
END;
12. August 2009 13:35
12. August 2009 17:43
Bubbleman hat geschrieben:Jetzt habe ich es entsprechend deines Vorschlages geändert und jetzt steht die Position noch drin, aber immer nur noch Anzahl=1. Merkwürdig. Kann mir da jetzt garkeinen Reim mehr drauf bilden. Hast du da noch eine Idee?
SETFILTER(Type,'>0');
SETFILTER(Quantity,'<>0');
/////
SETRANGE("Alternative Item Line",FALSE);
/////
SalesSetup.GET;
IF SalesLine."Alternative Item Line" THEN BEGIN
SalesLine."Line Amount" := 0;
SalesLine."Line Discount Amount" := 0;
"Sales Line"."Line Amount" := 0;
"Sales Line"."Line Discount Amount" := 0;
END;