Files
PowderCoatingLogix/src/PowderCoating.Application/DTOs/Vendor/VendorDtos.cs
T
spouliot fde24b09c9 Phase F: Add Invoice Write-Off, Fixed Assets, Period Locking, and 1099 Tracking
- Invoice Write-Off: WriteOff POST action in InvoicesController posts bad-debt JE
  (DR bad debt expense / CR AR), reduces customer balance, marks invoice WrittenOff;
  write-off modal added to Invoice Details view with expense account selector
- Fixed Assets: FixedAsset + FixedAssetDepreciationEntry entities with straight-line
  depreciation; FixedAssetsController (Index/Create/Edit/Details/PostDepreciation/Delete);
  PostDepreciation auto-generates one JE per asset per period, skips already-posted,
  fully-depreciated, and disposed assets; full CRUD views + nav link
- Period Locking: Company.BookLockedThrough field; AccountingPeriodValidator static helper;
  lock check added to JE Post and Bill Create (blocks backdating into closed periods);
  SetPeriodLock action + date picker UI in Company Settings Accounting section
- 1099 Tracking: Is1099Vendor flag on Vendor entity + DTOs; checkbox in Create/Edit views;
  TaxReporting1099 report action + view lists payments by year, flags vendors >= $600;
  report card added to Reports Landing
- Migration AddFixedAssetsLockAnd1099 applied

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 12:19:32 -04:00

213 lines
6.0 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace PowderCoating.Application.DTOs.Vendor;
// ============================================================================
// LIST DTO - For Index page listing
// ============================================================================
public class VendorListDto
{
public int Id { get; set; }
public string CompanyName { get; set; } = string.Empty;
public string? ContactName { get; set; }
public string? Phone { get; set; }
public string? Email { get; set; }
public bool IsActive { get; set; }
public bool IsPreferred { get; set; }
public int InventoryItemCount { get; set; }
}
// ============================================================================
// FULL VENDOR DTO - For Details page
// ============================================================================
public class VendorDto
{
public int Id { get; set; }
public string CompanyName { get; set; } = string.Empty;
public string? ContactName { get; set; }
public string? Phone { get; set; }
public string? Email { get; set; }
public string? Website { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public string? State { get; set; }
public string? ZipCode { get; set; }
public string? Country { get; set; }
public string? AccountNumber { get; set; }
public string? TaxId { get; set; }
public string? PaymentTerms { get; set; }
public decimal? CreditLimit { get; set; }
public string? Notes { get; set; }
public bool IsActive { get; set; }
public bool IsPreferred { get; set; }
public int? DefaultExpenseAccountId { get; set; }
public string? DefaultExpenseAccountName { get; set; }
public DateTime CreatedAt { get; set; }
}
// ============================================================================
// CREATE VENDOR DTO - For creating new vendors
// ============================================================================
public class CreateVendorDto
{
[Required]
[Display(Name = "Vendor Name")]
[StringLength(200)]
public string CompanyName { get; set; } = string.Empty;
[Display(Name = "Contact Name")]
[StringLength(100)]
public string? ContactName { get; set; }
[Display(Name = "Phone")]
[Phone]
[StringLength(20)]
public string? Phone { get; set; }
[Display(Name = "Email")]
[EmailAddress]
[StringLength(100)]
public string? Email { get; set; }
[Display(Name = "Website")]
[Url]
[StringLength(200)]
public string? Website { get; set; }
[Display(Name = "Address")]
[StringLength(200)]
public string? Address { get; set; }
[Display(Name = "City")]
[StringLength(100)]
public string? City { get; set; }
[Display(Name = "State")]
[StringLength(2)]
public string? State { get; set; }
[Display(Name = "Zip Code")]
[StringLength(10)]
public string? ZipCode { get; set; }
[Display(Name = "Country")]
[StringLength(50)]
public string? Country { get; set; }
[Display(Name = "Account Number")]
[StringLength(50)]
public string? AccountNumber { get; set; }
[Display(Name = "Tax ID / EIN")]
[StringLength(50)]
public string? TaxId { get; set; }
[Display(Name = "Payment Terms")]
[StringLength(100)]
public string? PaymentTerms { get; set; }
[Display(Name = "Credit Limit")]
[Range(0, 10000000)]
public decimal? CreditLimit { get; set; }
[Display(Name = "Notes")]
[DataType(DataType.MultilineText)]
public string? Notes { get; set; }
[Display(Name = "Active")]
public bool IsActive { get; set; } = true;
[Display(Name = "Preferred Vendor")]
public bool IsPreferred { get; set; } = false;
[Display(Name = "1099 Vendor")]
public bool Is1099Vendor { get; set; } = false;
[Display(Name = "Default Expense Account")]
public int? DefaultExpenseAccountId { get; set; }
}
// ============================================================================
// UPDATE VENDOR DTO - For editing existing vendors
// ============================================================================
public class UpdateVendorDto
{
public int Id { get; set; }
[Required]
[Display(Name = "Vendor Name")]
[StringLength(200)]
public string CompanyName { get; set; } = string.Empty;
[Display(Name = "Contact Name")]
[StringLength(100)]
public string? ContactName { get; set; }
[Display(Name = "Phone")]
[Phone]
[StringLength(20)]
public string? Phone { get; set; }
[Display(Name = "Email")]
[EmailAddress]
[StringLength(100)]
public string? Email { get; set; }
[Display(Name = "Website")]
[Url]
[StringLength(200)]
public string? Website { get; set; }
[Display(Name = "Address")]
[StringLength(200)]
public string? Address { get; set; }
[Display(Name = "City")]
[StringLength(100)]
public string? City { get; set; }
[Display(Name = "State")]
[StringLength(2)]
public string? State { get; set; }
[Display(Name = "Zip Code")]
[StringLength(10)]
public string? ZipCode { get; set; }
[Display(Name = "Country")]
[StringLength(50)]
public string? Country { get; set; }
[Display(Name = "Account Number")]
[StringLength(50)]
public string? AccountNumber { get; set; }
[Display(Name = "Tax ID / EIN")]
[StringLength(50)]
public string? TaxId { get; set; }
[Display(Name = "Payment Terms")]
[StringLength(100)]
public string? PaymentTerms { get; set; }
[Display(Name = "Credit Limit")]
[Range(0, 10000000)]
public decimal? CreditLimit { get; set; }
[Display(Name = "Notes")]
[DataType(DataType.MultilineText)]
public string? Notes { get; set; }
[Display(Name = "Active")]
public bool IsActive { get; set; }
[Display(Name = "Preferred Vendor")]
public bool IsPreferred { get; set; }
[Display(Name = "1099 Vendor")]
public bool Is1099Vendor { get; set; }
[Display(Name = "Default Expense Account")]
public int? DefaultExpenseAccountId { get; set; }
}