Skip to content

Commit

Permalink
Se agrega transacción de documento en metodo de Generar Numero de
Browse files Browse the repository at this point in the history
Control
  • Loading branch information
carlosaparadam committed Oct 2, 2024
1 parent 2d6992a commit 20899af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/base/org/erpya/lve/model/LVE.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public String docValidate(PO po, int timing) {
// Set Control No
if(!documentType.get_ValueAsBoolean(LVEUtil.COLUMNNAME_IsSetControlNoOnPrint)
&& Util.isEmpty(invoice.get_ValueAsString(LVEUtil.COLUMNNAME_ControlNo))) {
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType);
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType, invoice.get_TrxName());
invoice.set_ValueOfColumn(LVEUtil.COLUMNNAME_ControlNo, sequence.getControlNo());
}
//Set Document Number for Withholding
Expand Down Expand Up @@ -284,7 +284,7 @@ public String docValidate(PO po, int timing) {
// Set Control No
if(!documentType.get_ValueAsBoolean(LVEUtil.COLUMNNAME_IsSetControlNoOnPrint)
&& Util.isEmpty(shipment.get_ValueAsString(LVEUtil.COLUMNNAME_ControlNo))) {
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType);
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType, shipment.get_TrxName());
shipment.set_ValueOfColumn(LVEUtil.COLUMNNAME_ControlNo, sequence.getControlNo());
}
}
Expand All @@ -301,7 +301,7 @@ public String docValidate(PO po, int timing) {
// Set Control No
if(!documentType.get_ValueAsBoolean(LVEUtil.COLUMNNAME_IsSetControlNoOnPrint)
&& Util.isEmpty(movement.get_ValueAsString(LVEUtil.COLUMNNAME_ControlNo))) {
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType);
DocumentTypeSequence sequence = new DocumentTypeSequence(documentType, movement.get_TrxName());
movement.set_ValueOfColumn(LVEUtil.COLUMNNAME_ControlNo, sequence.getControlNo());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
*/
public class DocumentTypeSequence {

private String trxName = null;
/**
* From documentType
* @param documentType
*/
public DocumentTypeSequence(MDocType documentType) {
public DocumentTypeSequence(MDocType documentType, String trxName) {
this.documentType = documentType;
setTrxName(trxName);
}

/** Document Type */
Expand All @@ -48,7 +50,7 @@ public String getControlNo() {
int sequenceId = documentType.get_ValueAsInt(LVEUtil.COLUMNNAME_ControlNoSequence_ID);
// Load Sequence
if(sequenceId != 0) {
MSequence seqControlNo = new MSequence(Env.getCtx(), sequenceId, documentType.get_TrxName());
MSequence seqControlNo = new MSequence(Env.getCtx(), sequenceId, getTrxName());
String prefix = seqControlNo.getPrefix();
String suffix = seqControlNo.getSuffix();
String decimalPattern = seqControlNo.getDecimalPattern();
Expand Down Expand Up @@ -76,4 +78,20 @@ public String getControlNo() {
// Nothing
return null;
}

/**
* Get Transaction Name
* @return
*/
public String getTrxName() {
return trxName;
}

/**
* Set Transaction Name
* @param trxName
*/
public void setTrxName(String trxName) {
this.trxName = trxName;
}
}

0 comments on commit 20899af

Please sign in to comment.