namespace MMDAL.DTO.MMHead { public class MMDocumentFilterDTO { public int FromDocumentId { get; set; } = -1; public int ToDocumentId { get; set; } = -1; public string? FromDocumentNumber { get; set; } public string? ToDocumentNumber { get; set; } public int BizTransactionTypeId { get; set; } = -1; public int BizTransactionClassId { get; set; } = -1; public int BizTransactionSubClassId { get; set; } = -1; public int OUId { get; set; } = -1; public int? PartyId { get; set; } public int? PartyBranchId { get; set; } public int NumberOfCopy { get; set; } public int CopyNameTypeId { get; set; } = -1; public int IsOriginalOnly { get; set; } = 1; // Projection flags — client sets based on format being printed public bool IncludeCharges { get; set; } = true; public bool IncludeLotDetails { get; set; } = true; public bool IncludeB2BFields { get; set; } public bool IncludeSchedules { get; set; } public bool IncludeProcessDetails { get; set; } public bool IncludeParameters { get; set; } public bool IncludeAddons { get; set; } public bool IncludePackDetails { get; set; } public bool IncludeItemImages { get; set; } public bool IncludeVoucherDetails { get; set; } public bool IncludeCostCenterAllocations { get; set; } public bool IncludeItemPartyDocument { get; set; } public bool IncludePreDocumentChain { get; set; } } public class MMDocumentHeadPrintDTO { public int DocumentId { get; set; } public string DocumentNumber { get; set; } = ""; public DateTime DocumentDate { get; set; } public string ReferenceNumber { get; set; } = ""; public DateTime ReferenceDate { get; set; } public string PartyReferenceNumber { get; set; } = ""; public DateTime PartyReferenceDate { get; set; } public Int16 AmendmentSlNo { get; set; } public byte Status { get; set; } public string HeadRemarks { get; set; } = ""; public int BizTransactionTypeId { get; set; } public string BizTransactionTypeCode { get; set; } = ""; public string BizTransactionTypeName { get; set; } = ""; public string BizTransactionTypeDisplayName { get; set; } = ""; public int BizTransactionClassId { get; set; } public string BizTransactionClassCode { get; set; } = ""; public string BizTransactionClassName { get; set; } = ""; public int BizTransactionSubClassId { get; set; } public string BizTransactionSubClassCode { get; set; } = ""; public string BizTransactionSubClassName { get; set; } = ""; public int PeriodId { get; set; } public string PeriodCode { get; set; } = ""; public string PeriodName { get; set; } = ""; public int OUId { get; set; } public string OUDisplayName { get; set; } = ""; public string OUShortName { get; set; } = ""; public int CompanyId { get; set; } public string CompanyCode { get; set; } = ""; public string CompanyName { get; set; } = ""; public string CompanyShortName { get; set; } = ""; public string CompanyCINNumber { get; set; } = ""; public string ImportExportCode { get; set; } = ""; public string MSMEREGNO { get; set; } = ""; public string BranchCode { get; set; } = ""; public string BranchName { get; set; } = ""; public string DivisionCode { get; set; } = ""; public string DivisionName { get; set; } = ""; public int CurrencyId { get; set; } public string CurrencyCode { get; set; } = ""; public string CurrencyName { get; set; } = ""; public string CurrencySymbol { get; set; } = ""; public string CurrencyFull { get; set; } = ""; public decimal CurrencyConversion { get; set; } public int PartyId { get; set; } public string PartyCode { get; set; } = ""; public string PartyName { get; set; } = ""; public string PartyShortName { get; set; } = ""; public int PartyBranchId { get; set; } public string PartyBranchCode { get; set; } = ""; public string PartyBranchName { get; set; } = ""; public string BillLine1 { get; set; } = ""; public string BillLine2 { get; set; } = ""; public string BillLine3 { get; set; } = ""; public string BillLine4 { get; set; } = ""; public string Phone { get; set; } = ""; public string GSTINNumber { get; set; } = ""; public string StateCode { get; set; } = ""; public string StateName { get; set; } = ""; public string BillCountryCode { get; set; } = ""; public string BillCountryName { get; set; } = ""; public string BillMobile { get; set; } = ""; public string BillFax { get; set; } = ""; public string BillWeb { get; set; } = ""; public string BillMail { get; set; } = ""; public string BillZIPCode { get; set; } = ""; public string BillPAN { get; set; } = ""; public string BillExciseDivision { get; set; } = ""; public string BillExciseRange { get; set; } = ""; public string BillExciseCodeNumber { get; set; } = ""; public string BillExciseNotification { get; set; } = ""; public string BillExciseCollectrate { get; set; } = ""; public string BillExciseRegisterNumber { get; set; } = ""; public string BillServiceTaxNumber { get; set; } = ""; public string BillVATTINNUMBER { get; set; } = ""; public string BillVATCSTNUMBER { get; set; } = ""; public string BillRegionCode { get; set; } = ""; public string BillRegionName { get; set; } = ""; public string BillGSTStateCode { get; set; } = ""; public string ShipLine1 { get; set; } = ""; public string ShipLine2 { get; set; } = ""; public string ShipLine3 { get; set; } = ""; public string ShipLine4 { get; set; } = ""; public string ShipPhone { get; set; } = ""; public string ShipGSTINNumber { get; set; } = ""; public string ShipStateCode { get; set; } = ""; public string ShipStateName { get; set; } = ""; public string ShipCountryCode { get; set; } = ""; public string ShipCountryName { get; set; } = ""; public string ShipMobile { get; set; } = ""; public string ShipFax { get; set; } = ""; public string ShipWeb { get; set; } = ""; public string ShipMail { get; set; } = ""; public string ShipZIPCode { get; set; } = ""; public string ShipPAN { get; set; } = ""; public string ShipExciseDivision { get; set; } = ""; public string ShipExciseRange { get; set; } = ""; public string ShipExciseCodeNumber { get; set; } = ""; public string ShipExciseNotification { get; set; } = ""; public string ShipExciseCollectRate { get; set; } = ""; public string ShipExciseRegisterNumber { get; set; } = ""; public string ShipServiceTaxNumber { get; set; } = ""; public string ShipVATTINNumber { get; set; } = ""; public string ShipVATCSTNumber { get; set; } = ""; public string ShipRegionCode { get; set; } = ""; public string ShipRegionName { get; set; } = ""; public string ShipGSTStateCode { get; set; } = ""; public string OULine1 { get; set; } = ""; public string OULine2 { get; set; } = ""; public string OULine3 { get; set; } = ""; public string OULine4 { get; set; } = ""; public string OUPhone { get; set; } = ""; public string OUGSTINNumber { get; set; } = ""; public string OUStateCode { get; set; } = ""; public string OUStateName { get; set; } = ""; public string OUCountryCode { get; set; } = ""; public string OUCountryName { get; set; } = ""; public string OUMobile { get; set; } = ""; public string OUFax { get; set; } = ""; public string OUWeb { get; set; } = ""; public string OUMail { get; set; } = ""; public string OUZIPCode { get; set; } = ""; public string OUPAN { get; set; } = ""; public string OUExciseDivision { get; set; } = ""; public string OUExciseRange { get; set; } = ""; public string OUExciseCodeNumber { get; set; } = ""; public string OUExciseNotification { get; set; } = ""; public string OUExciseCollectRate { get; set; } = ""; public string OUExciseRegisterNumber { get; set; } = ""; public string OUServiceTaxNumber { get; set; } = ""; public string OUVATTINNumber { get; set; } = ""; public string OUVATCSTNumber { get; set; } = ""; public string OURegionCode { get; set; } = ""; public string OURegionName { get; set; } = ""; public string OUGSTStateCode { get; set; } = ""; public string PartyBranchLine1 { get; set; } = ""; public string PartyBranchLine2 { get; set; } = ""; public string PartyBranchLine3 { get; set; } = ""; public string PartyBranchLine4 { get; set; } = ""; public string PartyBranchPhone { get; set; } = ""; public string PartyBranchGSTINNumber { get; set; } = ""; public string PartyBranchStateCode { get; set; } = ""; public string PartyBranchStateName { get; set; } = ""; public string PartyBranchCountryCode { get; set; } = ""; public string PartyBranchCountryName { get; set; } = ""; public string PartyBranchMobile { get; set; } = ""; public string PartyBranchFax { get; set; } = ""; public string PartyBranchWeb { get; set; } = ""; public string PartyBranchMail { get; set; } = ""; public string PartyBranchZIPCode { get; set; } = ""; public string PartyBranchPAN { get; set; } = ""; public string PartyBranchExciseDivision { get; set; } = ""; public string PartyBranchExciseRange { get; set; } = ""; public string PartyBranchExciseCodeNumber { get; set; } = ""; public string PartyBranchExciseNotification { get; set; } = ""; public string PartyBranchExciseCollectRate { get; set; } = ""; public string PartyBranchExciseRegisterNumber { get; set; } = ""; public string PartyBranchServiceTaxNumber { get; set; } = ""; public string PartyBranchVATTINNumber { get; set; } = ""; public string PartyBranchVATCSTNumber { get; set; } = ""; public string PartyBranchRegionCode { get; set; } = ""; public string PartyBranchRegionName { get; set; } = ""; public string PartyBranchGSTStateCode { get; set; } = ""; public string OUBankAccountNumber { get; set; } = ""; public string OUBankBranchName { get; set; } = ""; public string OUBankIFSCCode { get; set; } = ""; public string OUBankSwiftCode { get; set; } = ""; public string OUBankBBAN { get; set; } = ""; public string OUBankRemarks { get; set; } = ""; public string OUBankCode { get; set; } = ""; public string OUBankName { get; set; } = ""; public int InsuranceId { get; set; } public string InsurancePolicyNumber { get; set; } = ""; public byte MMHeadMaterialReceiptStatus { get; set; } public string MMHeadPartyMaterialNumber { get; set; } = ""; public DateTime MMHeadPartyMaterialDate { get; set; } public string MMHeadPartyAccountedNumber { get; set; } = ""; public DateTime MMHeadPartyAccountedDate { get; set; } public string MMHeadContainerNo { get; set; } = ""; public decimal MMHeadCODAmount { get; set; } public byte DeliveryTermType { get; set; } public byte FreightType { get; set; } public string FreightRemarks { get; set; } = ""; public string FinalDestination { get; set; } = ""; public string BlNumber { get; set; } = ""; public DateTime BlDate { get; set; } public string SbNumber { get; set; } = ""; public DateTime SbDate { get; set; } public byte AREType { get; set; } public string ARENumber { get; set; } = ""; public DateTime AREDate { get; set; } public string VesselNo { get; set; } = ""; public string PreCarriage { get; set; } = ""; public string CExciseseAlNo { get; set; } = ""; public string BottleSealNo { get; set; } = ""; public string CartonDescription { get; set; } = ""; public string PackDescription { get; set; } = ""; public string CartonMarks { get; set; } = ""; public string ReceiptPlace { get; set; } = ""; public string MMHeadOpenName { get; set; } = ""; public string MMHeadOpenPhone { get; set; } = ""; public string MMHeadOpenMail { get; set; } = ""; public decimal MMHeadAdvanceAmount { get; set; } public string MMHeadOpenGSTNo { get; set; } = ""; public int GateEntryId { get; set; } public string GateEntryNumber { get; set; } = ""; public DateTime MMHeadDespatchedOn { get; set; } public int MMHeadExciseRegisterLastNo { get; set; } public byte MMHeadStockPosting { get; set; } public byte MMHeadFromQualityType { get; set; } public byte MMHeadToQualityType { get; set; } public byte MMHeadLRPaymentType { get; set; } public string MMHeadLRAmount { get; set; } = ""; public string MMHeadLRBilledNumber { get; set; } = ""; public DateTime MMHeadEffectiveFrom { get; set; } public DateTime MMHeadEffectiveTo { get; set; } public string MMHeadRevisionNumber { get; set; } = ""; public DateTime MMHeadRevisionDate { get; set; } public int RevisedFromDocumentId { get; set; } public int RevisedTodocumentId { get; set; } public int PrimaryDocumentId { get; set; } public byte MMHeadDocumentStatus { get; set; } public byte MMHeadDocumentType { get; set; } public byte MMHeadIsStandardBill { get; set; } public byte MMHeadIsSeparateBill { get; set; } public Int16 MMHeadNoOfOrginalCopy { get; set; } public Int16 MMHeadNoOfCopyTaken { get; set; } public int PaymentTermId { get; set; } public string MMHeadSpecialInstruction { get; set; } = ""; public byte MMHeadIsAccountPost { get; set; } public int TaxTransactionTypeId { get; set; } public string TaxTransactionTypeCode { get; set; } = ""; public string TaxTransactionTypeName { get; set; } = ""; public byte TaxTransactionLocationType { get; set; } public int DutyTransactionTypeId { get; set; } public string DutyTransactionTypeCode { get; set; } = ""; public string DutyTransactionTypeName { get; set; } = ""; public byte DutyTransactionTypeTrackingType { get; set; } public byte DutyTransactionLocationType { get; set; } public byte MMHeadShipmentType { get; set; } public int TransporterId { get; set; } public string TransporterCode { get; set; } = ""; public string TransporterName { get; set; } = ""; public int VehicleId { get; set; } public string VehicleNumber { get; set; } = ""; public string MMHeadDeliveryTerms { get; set; } = ""; public string MMHeadDeliveryInstructions { get; set; } = ""; public byte MMHeadIsCapitalUse { get; set; } public byte MMHeadNature { get; set; } public int CountryId { get; set; } public string CountryCode { get; set; } = ""; public string CountryName { get; set; } = ""; public int FromPortId { get; set; } public string FromPortName { get; set; } = ""; public int ToPortId { get; set; } public string ToPortName { get; set; } = ""; public int MerchandiserId { get; set; } public string MerchandiserCode { get; set; } = ""; public string MerchandiserName { get; set; } = ""; public string MerchandiserPrimaryMail { get; set; } = ""; public string MerchandiserPrimaryMobile { get; set; } = ""; public int ParameterSetId { get; set; } public string ParameterSetCode { get; set; } = ""; public string ParameterSetName { get; set; } = ""; public string MMHeadSeason { get; set; } = ""; public int VoucherId { get; set; } public string VoucherVoucherNumber { get; set; } = ""; public int LotId { get; set; } public string LotLotNumber { get; set; } = ""; public int ToCountryId { get; set; } public string ToCountryCode { get; set; } = ""; public string ToCountryName { get; set; } = ""; public byte MMHeadFormsReceivedStatus { get; set; } public string MMHeadFormsReceivedType { get; set; } = ""; public string MMHeadFormsReceivedNumber { get; set; } = ""; public DateTime MMHeadFormsReceivedDate { get; set; } public decimal MMHeadFormsReceivedValue { get; set; } public byte MMHeadFormsIssuedStatus { get; set; } public string MMHeadFormsIssuedNumber { get; set; } = ""; public DateTime MMHeadFormsIssuedDate { get; set; } public decimal MMHeadFormsIssuedValue { get; set; } public byte MMHeadStatus { get; set; } public Int16 MMHeadVersion { get; set; } public int StoreId { get; set; } public string StoreCode { get; set; } = ""; public string StoreName { get; set; } = ""; public decimal BillValue { get; set; } public decimal TotalItemBasicValue { get; set; } public decimal TotalNetValue { get; set; } public decimal DocumentValue { get; set; } public decimal RoundOff { get; set; } public decimal TotalGrossWeight { get; set; } public decimal TotalNetWeight { get; set; } public decimal TotalItemGrossValue { get; set; } public decimal TotalItemGrossValueFC { get; set; } public decimal MMHeadDocumentRealisationValueFC { get; set; } public decimal TotalQuantity { get; set; } public decimal TotalPacks { get; set; } public decimal TotalItemAmountPlus { get; set; } public decimal TotalItemAmountMinus { get; set; } public decimal TotalOtherAmountPlus { get; set; } public decimal TotalOtherAmountMinus { get; set; } public decimal CostValue { get; set; } public decimal RealisationValue { get; set; } public string LRNumber { get; set; } = ""; public DateTime LRDate { get; set; } public string InchargeCode { get; set; } = ""; public string InchargeName { get; set; } = ""; public string InchargePrimaryMail { get; set; } = ""; public string InchargePrimaryMobile { get; set; } = ""; public string PaymentTermName { get; set; } = ""; public string PaymentTermsRemarks { get; set; } = ""; public string ModeOfPayment { get; set; } = ""; public string AcknowledgementNumber { get; set; } = ""; public DateTime AcknowledgementDate { get; set; } public string EBNumber { get; set; } = ""; public DateTime EwayDate { get; set; } public string SIGNEDQRCODE { get; set; } = ""; public string CreatedByName { get; set; } = ""; public string ModifiedByName { get; set; } = ""; public DateTime CreatedOn { get; set; } public DateTime ModifiedOn { get; set; } public string CopyName { get; set; } = ""; public byte CopyNumber { get; set; } public int RouteId { get; set; } public string RouteCode { get; set; } = ""; public string RouteName { get; set; } = ""; public int DepartmentId { get; set; } public string DepartmentCode { get; set; } = ""; public string DepartmentName { get; set; } = ""; public int AllocationId { get; set; } public string AllocationName { get; set; } = ""; public string CurrencyDecimalName { get; set; } = ""; public int TermSetId { get; set; } public int MMHeadDocumentChargesId { get; set; } // Server-computed for print public string? AmountInWords { get; set; } } public class MMDocumentDetailPrintDTO { public int DocumentDetailId { get; set; } public int DocumentId { get; set; } public int SlNo { get; set; } // Item public int ItemId { get; set; } public string ItemCode { get; set; } = ""; public string ItemName { get; set; } = ""; public string ItemDescription { get; set; } = ""; public int SKUId { get; set; } public string SKUCode { get; set; } = ""; public string SKUName { get; set; } = ""; public string HSNCode { get; set; } = ""; // Quantity & UOM public decimal Qty { get; set; } public string UOMCode { get; set; } = ""; public decimal ActualQty { get; set; } public decimal BalanceQuantity { get; set; } public int StockPostType { get; set; } public decimal LastPurchaseRate { get; set; } // Rate & Value public decimal Rate { get; set; } public decimal MRPRate { get; set; } public decimal ItemBasicValue { get; set; } public decimal ItemAmountPlus { get; set; } public decimal ItemAmountMinus { get; set; } public decimal ItemGrossValue { get; set; } public decimal ItemNetValue { get; set; } public decimal DutyAmount { get; set; } // Tax — raw decimals from TMMCHARGESPIVOT (template formats display) public decimal CgstRate { get; set; } public decimal CgstAmount { get; set; } public decimal SgstRate { get; set; } public decimal SgstAmount { get; set; } public decimal IgstRate { get; set; } public decimal IgstAmount { get; set; } public decimal UGSTRate { get; set; } public decimal UGSTAmount { get; set; } public decimal CESSRate { get; set; } public decimal CESSAmount { get; set; } public decimal DiscountPercent { get; set; } public decimal DiscountAmountCalculated { get; set; } public decimal TCSRate { get; set; } public decimal TCSAmount { get; set; } // Pre-document traceability public int? PreDocumentId { get; set; } public string PreDocumentNumber { get; set; } = ""; // B2B-only fields (null when IncludeB2BFields=false) public string? BuyerOrderNumber { get; set; } public string? GSTTariffCode { get; set; } public string? GSTTariffName { get; set; } // Remarks & flags public string Remarks { get; set; } = ""; public bool IsFree { get; set; } public decimal FreeAmount { get; set; } // Quality public int QualityStatus { get; set; } public decimal GoodQuantity { get; set; } public decimal RejectedQuantity { get; set; } // Delivery public DateTime? RequiredDeliveryDate { get; set; } public DateTime? PlanDeliveryDate { get; set; } // Model (via MITEM.MODELID → MMODEL) public int ModelId { get; set; } public string ModelCode { get; set; } = ""; public string ModelName { get; set; } = ""; // Brand (via MITEM.ITEMBRANDID → MITEMBRAND) public int BrandId { get; set; } public string BrandCode { get; set; } = ""; public string BrandName { get; set; } = ""; } public class MMDocumentChargePrintDTO { public int DocumentChargesId { get; set; } public int DocumentId { get; set; } public int DocumentDetailId { get; set; } // -1 = header-level charge public int SlNo { get; set; } public string ChargeNature { get; set; } = ""; // from MCHARGEDETAIL.CHARGENATURE public string ChargeName { get; set; } = ""; // from MCHARGEELEMENT.CHARGEELEMENTNAME public string ChargeElementCode { get; set; } = ""; // from MCHARGEELEMENT.CHARGEELEMENTCODE public decimal InputValue { get; set; } public int InputType { get; set; } // 0=Percentage, 1=Value public decimal CalculatedOn { get; set; } public decimal CalculatedValue { get; set; } public decimal AmountPlus { get; set; } public decimal AmountMinus { get; set; } public int OperationType { get; set; } // 0=Add, 1=Subtract, 2=Info public bool IncludeInCost { get; set; } public decimal FCCalculatedValue { get; set; } public decimal CurrencyConversion { get; set; } public string FormulaCode { get; set; } = ""; public string FormulaName { get; set; } = ""; public string PrintingName { get; set; } = ""; public int PrintRequired { get; set; } } public class MMHeadTermsDTO { public int TermsSetId { get; set; } public int TermsSetType { get; set; } public int Slno { get; set; } public int TermsType { get; set; } public string TermsSetName { get; set; } = ""; public string TermsDescription { get; set; } = ""; public string TermsSection { get; set; } = ""; public string RefereceNo { get; set; } = ""; } public class MMDocumentLotDetailPrintDTO { public int DocumentDetailId { get; set; } public int LotId { get; set; } public int SNo { get; set; } public string LotNumber { get; set; } = ""; public string StockLedgerNumber { get; set; } = ""; public DateTime? StockLedgerDate { get; set; } public string ItemCode { get; set; } = ""; public string ItemName { get; set; } = ""; public string ItemCategoryCode { get; set; } = ""; public string ItemCategoryName { get; set; } = ""; public string KRM { get; set; } = ""; public string ProductCode { get; set; } = ""; public string DGSetSlNo { get; set; } = ""; } public class MMDocumentSchedulePrintDTO { public int MMScheduleId { get; set; } public int DocumentId { get; set; } public int DocumentDetailId { get; set; } public int MMScheduleSlNo { get; set; } public DateTime MMScheduleDate { get; set; } public decimal ScheduleQuantity { get; set; } public decimal GoodQuantity { get; set; } public decimal RejectedQuantity { get; set; } public decimal ReworkQuantity { get; set; } public string Remarks { get; set; } = ""; } public class MMDocumentProcessPrintDTO { public int MMDetailProcessId { get; set; } public int DocumentDetailId { get; set; } public int MMDetailProcessSlNo { get; set; } public int ProcessId { get; set; } public string ProcessCode { get; set; } = ""; public string ProcessName { get; set; } = ""; public string ProcessTypeName { get; set; } = ""; public string SubProcessName { get; set; } = ""; public decimal ProcessCharges { get; set; } } public class MMDocumentParameterPrintDTO { public int MMParameterId { get; set; } public int DocumentDetailId { get; set; } public int MMParameterSlNo { get; set; } public int ParameterId { get; set; } public string ParameterCode { get; set; } = ""; public string ParameterName { get; set; } = ""; public string UOMCode { get; set; } = ""; public decimal Standard { get; set; } public decimal Actual { get; set; } public decimal Minimum { get; set; } public decimal Maximum { get; set; } public string StandardText { get; set; } = ""; public string ActualText { get; set; } = ""; public string Remarks { get; set; } = ""; } public class MMDocumentAddonPrintDTO { public int MMAddonId { get; set; } public int DocumentId { get; set; } public int DocumentDetailId { get; set; } public int MMAddonSlNo { get; set; } public string ParameterCode { get; set; } = ""; public string ParameterName { get; set; } = ""; public string InputText { get; set; } = ""; public decimal InputValue { get; set; } public decimal FinalValue { get; set; } public DateTime? InputDate { get; set; } } public class MMDocumentPackDetailPrintDTO { public int PackDetailId { get; set; } public int DocumentId { get; set; } public int DocumentDetailId { get; set; } public int PackDetailSlNo { get; set; } public string PackNumberNumber { get; set; } = ""; public string LotNumber { get; set; } = ""; public decimal Quantity { get; set; } public decimal GoodQuantity { get; set; } public decimal RejectedQuantity { get; set; } public decimal GrossWeight { get; set; } public decimal NetWeight { get; set; } public string StockLedgerNumber { get; set; } = ""; public DateTime? StockLedgerDate { get; set; } } // Item primary image from TATTACHMENT (objecttypeid = -1899999573). // AttachmentId allows the caller to construct a thumbnail URL via the Attachment API. public class MMDocumentItemImagePrintDTO { public int ItemId { get; set; } public int AttachmentId { get; set; } public string FileName { get; set; } = ""; public string LinkUrl { get; set; } = ""; } // Journal voucher account line linked to the document (TMMHEAD.VOUCHERID → TVOUCHER → TVOUCHERDETAIL). public class MMDocumentVoucherDetailPrintDTO { public int VoucherDetailId { get; set; } public int VoucherId { get; set; } public int DocumentId { get; set; } public int VoucherAccountId { get; set; } public string AccountCode { get; set; } = ""; public string AccountName { get; set; } = ""; public decimal DR { get; set; } public decimal CR { get; set; } } // Bill allocation / payment schedule for the voucher. public class MMDocumentBillAllocationPrintDTO { public int VoucherDetailId { get; set; } public int DocumentId { get; set; } public string ReferenceNumber { get; set; } = ""; public DateTime? ReferenceDate { get; set; } public DateTime? DueDate { get; set; } public DateTime? PlanDate { get; set; } public string DetailNumber { get; set; } = ""; public DateTime? DetailDate { get; set; } public int DueDays { get; set; } public int DueType { get; set; } public int AllocationType { get; set; } } // Cost-center distribution per document detail line. public class MMDocumentCostCenterAllocationPrintDTO { public int CostCenterAllocationId { get; set; } public int DocumentId { get; set; } public int DocumentDetailId { get; set; } public int SlNo { get; set; } public int CostCategoryId { get; set; } public string CostCategoryCode { get; set; } = ""; public string CostCategoryName { get; set; } = ""; public int CostCenterId { get; set; } public string CostCenterCode { get; set; } = ""; public string CostCenterName { get; set; } = ""; public decimal AllocatedQuantity { get; set; } } // Item-party price agreement document reference per detail line. public class MMDocumentItemPartyPrintDTO { public int DocumentId { get; set; } public int DocumentDetailId { get; set; } public int ItemId { get; set; } public int SKUId { get; set; } public string ItemPartyCode { get; set; } = ""; public string ItemPartyName { get; set; } = ""; public DateTime? EffectiveFrom { get; set; } public DateTime? EffectiveTo { get; set; } public int ItemPartyDocumentId { get; set; } public string ItemPartyDocumentNumber { get; set; } = ""; public string ItemPartyReferenceNumber { get; set; } = ""; public DateTime? ItemPartyReferenceDate { get; set; } } // Pre-document chain row — one per DocumentDetailId, all 3 predecessor levels flattened. // Sourced from MV_MMDocumentChain (physical pre-computed table, refresh via SP). // PreHeaderTypeId = -1899997952 (MM doc), -1899997569 (Indent), 0 = no chain. public class MMDocumentPreDocumentChainDTO { public int DocumentId { get; set; } public int DocumentDetailId { get; set; } // Level 1 (Pre) public int PreHeaderTypeId { get; set; } public int PreDocumentId { get; set; } public string PreDocumentNumber { get; set; } = ""; public DateTime? PreDocumentDate { get; set; } public string PreReferenceNumber { get; set; } = ""; public int PreDocumentDetailId { get; set; } public int PreDocumentSlNo { get; set; } public decimal PreAllocationQuantity { get; set; } // Level 2 (PrePre) public int PrePreHeaderTypeId { get; set; } public int PrePreDocumentId { get; set; } public string PrePreDocumentNumber { get; set; } = ""; public DateTime? PrePreDocumentDate { get; set; } public string PrePreReferenceNumber { get; set; } = ""; public int PrePreDocumentDetailId { get; set; } public decimal PrePreAllocationQuantity { get; set; } // Level 3 (PrePrePre) public int PrePrePreHeaderTypeId { get; set; } public int PrePrePreDocumentId { get; set; } public string PrePrePreDocumentNumber { get; set; } = ""; public DateTime? PrePrePreDocumentDate { get; set; } } public class MMDocumentPrintResponseDTO { public List Heads { get; set; } = []; public List Details { get; set; } = []; public List Charges { get; set; } = []; public List LotDetails { get; set; } = []; public List Schedules { get; set; } = []; public List Processes { get; set; } = []; public List Parameters { get; set; } = []; public List Addons { get; set; } = []; public List PackDetails { get; set; } = []; public List ItemImages { get; set; } = []; public List VoucherDetails { get; set; } = []; public List BillAllocations { get; set; } = []; public List CostCenterAllocations { get; set; } = []; public List ItemPartyDocuments { get; set; } = []; public List PreDocumentChain { get; set; } = []; public List Terms { get; set; } = []; } }