Version 2.1.13.0: cabecera de la NC en un solo metodo (CabeceraNotaCredito.Completar)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2fb7509fc2
commit
a65cd4d90a
5 files changed
+70
-64
No files matched your search
@@ -0,0 +1,53 @@
|
||||
using Net.Business.Entities.ServicesLayer.CreditNotes;
|
||||
using Net.Data.HelperData.Correlativo;
|
||||
using System;
|
||||
|
||||
namespace Net.Data.ServicesLayer.CreditNotes
|
||||
{
|
||||
// Cabecera de la nota de credito (Picking DESPACHO, Picking PICKING estado 13 y Recibo Devolucion).
|
||||
// Antes la serie, el correlativo y estos campos estaban copiados 3 veces.
|
||||
public static class CabeceraNotaCredito
|
||||
{
|
||||
// Completa la cabecera de la NC con los datos del documento origen (la factura o, en Recibo sin factura,
|
||||
// la solicitud de devolucion). Las lineas las arma cada llamador.
|
||||
// tipoOrigen/serieOrigen/correlativoOrigen: U_SYP_MDTD / U_SYP_MDSD / U_SYP_MDCD del documento origen.
|
||||
public static void Completar(BE_CreditNotesNotes nc, string docCurrency, string cardCode, string cardName, string paymentGroupCode,
|
||||
string tipoOrigen, string serieOrigen, string correlativoOrigen, DateTime fechaOrigen, string motivo, string tipoMotivo)
|
||||
{
|
||||
// v2.1.7.0: la serie sale del TIPO del documento origen (03 = boleta -> BC10, otro -> FC10), no de su serie.
|
||||
// En Recibo se comparaba la serie origen (p. ej. B005) con "03" y siempre salia FC10.
|
||||
// Pendiente: validar con contabilidad la serie de boletas.
|
||||
string serie = SerieNotaCredito(tipoOrigen);
|
||||
|
||||
// El correlativo sale de @SYP_NUMDOC (HelperCorrelativo)
|
||||
string correlativo = HelperCorrelativo.Get(serie);
|
||||
|
||||
nc.DocCurrency = docCurrency;
|
||||
nc.CardCode = cardCode;
|
||||
nc.CardName = cardName;
|
||||
nc.PaymentGroupCode = paymentGroupCode;
|
||||
nc.DocDate = DateTime.Now;
|
||||
nc.DocDueDate = DateTime.Now;
|
||||
|
||||
// Documento origen (el que se devuelve)
|
||||
nc.U_SYP_MDTO = tipoOrigen;
|
||||
nc.U_SYP_MDCO = correlativoOrigen;
|
||||
nc.U_SYP_MDSO = serieOrigen;
|
||||
nc.U_SYP_FECHAREF = fechaOrigen.ToString("yyyy-MM-dd");
|
||||
|
||||
nc.U_SYP_MOTNC = motivo;
|
||||
nc.U_SYP_TPONC = tipoMotivo;
|
||||
|
||||
// La NC misma: tipo 07, con la serie y el correlativo elegidos arriba
|
||||
nc.U_SYP_MDTD = "07";
|
||||
nc.U_SYP_MDSD = serie;
|
||||
nc.U_SYP_MDCD = correlativo;
|
||||
nc.NumAtCard = "07-" + serie + "-" + correlativo;
|
||||
}
|
||||
|
||||
public static string SerieNotaCredito(string tipoOrigen)
|
||||
{
|
||||
return tipoOrigen == "03" ? "BC10" : "FC10";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user