コード例 #1
0
        protected virtual void DocumentSelection_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e)
        {
            ARRegister documentAsRegister = e.Row as ARRegister;

            if (documentAsRegister != null && documentAsRegister.Voided == false && documentAsRegister.Scheduled == false)
            {
                ARReleaseProcess.UpdateARBalances(this, documentAsRegister, -documentAsRegister.OrigDocAmt);

                documentAsRegister.Scheduled  = true;
                documentAsRegister.ScheduleID = Schedule_Header.Current.ScheduleID;

                ARReleaseProcess.UpdateARBalances(this, documentAsRegister, documentAsRegister.OrigDocAmt);
            }

            DocumentSelection document = e.Row as DocumentSelection;

            if (document != null &&
                !string.IsNullOrWhiteSpace(document.DocType) &&
                !string.IsNullOrWhiteSpace(document.RefNbr) &&
                PXSelectorAttribute.Select <DocumentSelection.refNbr>(cache, document) == null)
            {
                cache.RaiseExceptionHandling <DocumentSelection.refNbr>(
                    document,
                    document.RefNbr,
                    new PXSetPropertyException(AP.Messages.ReferenceNotValid));

                Document_Detail.Cache.Remove(document);
            }
        }
コード例 #2
0
        protected virtual void StatusSet(PXCache sender, ARRegister doc)
        {
            var docExt = doc.GetExtension <MXARRegisterExtension>();

            if (docExt == null)
            {
                return;
            }

            var status = CfdiStatus.Clean;

            if (docExt.CancelDate.HasValue)
            {
                status = CfdiStatus.Canceled;
            }
            else if (docExt.StampDate.HasValue)
            {
                status = CfdiStatus.Stamped;
            }
            else if (docExt.Uuid.HasValue)
            {
                status = CfdiStatus.Blocked;
            }
            else
            {
                status = CfdiStatus.Clean;
            }

            sender.SetValue <MXARRegisterExtension.stampStatus>(doc, status);
        }
コード例 #3
0
        protected virtual void ARInvoice_UsrContractID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e, PXFieldUpdated del)
        {
            // Event handler body before the base BLC event handler collection
            if (del != null)
            {
                del(sender, e);
            }
            // Event handler body after the base BLC event handler collection
            if (e.Row != null)
            {
                ARRegister    row       = (ARRegister)e.Row;
                ARRegisterExt invoiceEX = PXCache <ARRegister> .GetExtension <ARRegisterExt>(row);

                if (invoiceEX.UsrContractID != null)
                {
                    MaxQ.Products.RBRR.XRBContrHdr contract = PXSelect <MaxQ.Products.RBRR.XRBContrHdr,
                                                                        Where <MaxQ.Products.RBRR.XRBContrHdr.contractID,
                                                                               Equal <Required <MaxQ.Products.RBRR.XRBContrHdr.contractID> > > > .Select(Base, invoiceEX.UsrContractID);

                    sender.SetValue <ARRegisterExt.usrContractCD>(e.Row, contract.ContractCD);
                    sender.SetValue <ARRegisterExt.usrRevisionNbr>(e.Row, contract.RevisionNbr);
                    sender.SetValue <ARInvoice.invoiceNbr>(e.Row, contract.ContractCDRevNbr);
                }
            }
        }
コード例 #4
0
ファイル: IsSchedulable.cs プロジェクト: mperry246/CAMP
 public static void Ensure(PXGraph graph, ARRegister document)
 {
     if (!IsDocumentSchedulable(graph, document))
     {
         throw new PXException(Messages.DocumentCannotBeScheduled);
     }
 }
コード例 #5
0
        public void Persist(PersistDelegate baseMethod)
        {
            if (SharedFunctions.isFSSetupSet(Base) == false ||
                PXAccess.FeatureInstalled <FeaturesSet.equipmentManagementModule>() == false)
            {
                baseMethod();
                return;
            }

            //// Invoice
            ARRegister arRegisterRow                      = (ARRegister)Base.Caches[typeof(ARRegister)].Current;
            Dictionary <int?, int?> newEquiments          = new Dictionary <int?, int?>();
            SMEquipmentMaint        graphSMEquipmentMaint = PXGraph.CreateInstance <SMEquipmentMaint>();

            if (processEquipmentAndComponents)
            {
                CreateEquipments(graphSMEquipmentMaint, arRegisterRow, newEquiments);
                ReplaceEquipments(graphSMEquipmentMaint, arRegisterRow);
                UpgradeEquipmentComponents(graphSMEquipmentMaint, arRegisterRow, newEquiments);
                CreateEquipmentComponents(graphSMEquipmentMaint, arRegisterRow, newEquiments);
                ReplaceComponents(graphSMEquipmentMaint, arRegisterRow);
            }

            baseMethod();
        }
コード例 #6
0
        protected virtual void ARSetup_MigrationMode_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            ARSetup row = e.Row as ARSetup;

            if (row == null)
            {
                return;
            }

            bool?oldvalue = (bool?)e.OldValue;

            if (row.MigrationMode == true && oldvalue != true)
            {
                GLTran glTransactionFromModule = PXSelect <GLTran,
                                                           Where <GLTran.module, Equal <BatchModule.moduleAR> > > .SelectSingleBound(this, null);

                if (glTransactionFromModule != null)
                {
                    sender.RaiseExceptionHandling <ARSetup.migrationMode>(row, row.MigrationMode,
                                                                          new PXSetPropertyException(Common.Messages.MigrationModeActivateGLTransactionFromModuleExist, PXErrorLevel.Warning));
                }
            }
            else if (row.MigrationMode != true && oldvalue == true)
            {
                ARRegister unreleasedMigratedDocument = PXSelect <ARRegister,
                                                                  Where <ARRegister.released, NotEqual <True>,
                                                                         And <ARRegister.isMigratedRecord, Equal <True> > > > .SelectSingleBound(this, null);

                if (unreleasedMigratedDocument != null)
                {
                    sender.RaiseExceptionHandling <ARSetup.migrationMode>(row, row.MigrationMode,
                                                                          new PXSetPropertyException(Common.Messages.MigrationModeDeactivateUnreleasedMigratedDocumentExist, PXErrorLevel.Warning));
                }
            }
        }
コード例 #7
0
        protected static void Accumulate(ARStatement aDest, ARRegister aSrc1, ARStatementCycle aSrc2, bool isNewDoc, bool aAgeCredits)
        {
            ARInvoice inv = aSrc1 as ARInvoice;

            Copy(aDest, aSrc2);
            if (isNewDoc)
            {
                aDest.EndBalance     = (aDest.EndBalance ?? Decimal.Zero) + ((aSrc1.Payable ?? false) ? aSrc1.OrigDocAmt : (-aSrc1.OrigDocAmt));
                aDest.CuryEndBalance = (aDest.CuryEndBalance ?? Decimal.Zero) + ((aSrc1.Payable ?? false) ? aSrc1.CuryOrigDocAmt : (-aSrc1.CuryOrigDocAmt));
            }
            //ARDocType.SmallCreditWO - is an invoice, but it must be processed as payment
            int days = 0;

            if (inv != null && inv.DocType != ARDocType.SmallCreditWO)
            {
                TimeSpan diff = (aDest.StatementDate.Value.Subtract(inv.DueDate.Value));
                days = diff.Days;
            }
            else
            {
                TimeSpan diff = (aDest.StatementDate.Value.Subtract(aSrc1.DocDate.Value));
                days = diff.Days;
            }
            if ((inv != null && inv.DocType != ARDocType.SmallCreditWO) || aAgeCredits)
            {
                Decimal docBal     = ((bool)aSrc1.Paying) ? -aSrc1.DocBal.Value : aSrc1.DocBal.Value;
                Decimal curyDocBal = ((bool)aSrc1.Paying) ? -aSrc1.CuryDocBal.Value : aSrc1.CuryDocBal.Value;
                if (days <= 0)
                {
                    aDest.AgeBalance00     = (aDest.AgeBalance00 ?? Decimal.Zero) + docBal;
                    aDest.CuryAgeBalance00 = (aDest.CuryAgeBalance00 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!aSrc2.AgeDays00.HasValue || days <= aSrc2.AgeDays00)
                {
                    aDest.AgeBalance01     = (aDest.AgeBalance01 ?? Decimal.Zero) + docBal;
                    aDest.CuryAgeBalance01 = (aDest.CuryAgeBalance01 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!aSrc2.AgeDays01.HasValue || days <= aSrc2.AgeDays01)
                {
                    aDest.AgeBalance02     = (aDest.AgeBalance02 ?? Decimal.Zero) + docBal;
                    aDest.CuryAgeBalance02 = (aDest.CuryAgeBalance02 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!aSrc2.AgeDays02.HasValue || days <= aSrc2.AgeDays02)
                {
                    aDest.AgeBalance03     = (aDest.AgeBalance03 ?? Decimal.Zero) + docBal;
                    aDest.CuryAgeBalance03 = (aDest.CuryAgeBalance03 ?? Decimal.Zero) + curyDocBal;
                }
                else
                {
                    aDest.AgeBalance04     = (aDest.AgeBalance04 ?? Decimal.Zero) + docBal;
                    aDest.CuryAgeBalance04 = (aDest.CuryAgeBalance04 ?? Decimal.Zero) + curyDocBal;
                }
            }
            else
            {
                //Payments, when credits are not aged
                aDest.AgeBalance04     = aDest.AgeBalance04 - aSrc1.DocBal;             //After completion we must apply resedual payments to previous buckets
                aDest.CuryAgeBalance04 = aDest.CuryAgeBalance04 - aSrc1.CuryDocBal;
            }
        }
コード例 #8
0
        protected virtual void CABatchDetail_RowDeleting(PXCache sender, PXRowDeletingEventArgs e)
        {
            CABatchDetail row        = (CABatchDetail)e.Row;
            bool          isReleased = false;
            bool          isVoided   = false;

            if (row.OrigModule == GL.BatchModule.AP)
            {
                APRegister apDocument = PXSelect <APRegister, Where <APRegister.docType, Equal <Required <APRegister.docType> >,
                                                                     And <APRegister.refNbr, Equal <Required <APRegister.refNbr> > > > > .Select(this, row.OrigDocType, row.OrigRefNbr);

                isReleased = (bool)apDocument.Released;
                isVoided   = (bool)apDocument.Voided;
            }

            if (row.OrigModule == GL.BatchModule.AR)
            {
                ARRegister arDocument = PXSelect <ARRegister, Where <ARRegister.docType, Equal <Required <ARRegister.docType> >,
                                                                     And <ARRegister.refNbr, Equal <Required <ARRegister.refNbr> > > > > .Select(this, row.OrigDocType, row.OrigRefNbr);

                isReleased = (bool)arDocument.Released;
                isVoided   = (bool)arDocument.Voided;
            }

            if (isReleased && !isVoided)
            {
                throw new PXException(Messages.ReleasedDocumentMayNotBeDeletedFromCABatch);
            }
        }
コード例 #9
0
 /// <summary>
 /// Indicates whether the record is a child Retainage document
 /// with <see cref="ARRegister.IsRetainageDocument"/> flag equal to true
 /// and existing reference on the original Retainage document.
 /// </summary>
 public static bool IsChildRetainageDocument(this ARRegister doc)
 {
     return
         (doc.IsRetainageDocument == true &&
          !string.IsNullOrEmpty(doc.OrigDocType) &&
          !string.IsNullOrEmpty(doc.OrigRefNbr));
 }
コード例 #10
0
        public virtual ARRegister OnBeforeRelease(ARRegister ardoc)
        {
            var invoice = ardoc as ARInvoice;

            if (invoice == null || !IsExternalTax(invoice.TaxZoneID))
            {
                return(ardoc);
            }

            if (invoice.OrigModule == GL.BatchModule.SO)
            {
                var rg = LazySoInvoiceEntry.Value;
                rg.Clear();

                rg.Document.Current = PXSelect <ARInvoice, Where <ARInvoice.docType, Equal <Required <ARInvoice.docType> >, And <ARInvoice.refNbr, Equal <Required <ARInvoice.refNbr> > > > > .Select(rg, invoice.DocType, invoice.RefNbr);

                rg.Document.Current.ApplyPaymentWhenTaxAvailable = invoice.ApplyPaymentWhenTaxAvailable;
                rg.SODocument.Current = PXSelect <SOInvoice, Where <SOInvoice.docType, Equal <Required <SOInvoice.docType> >, And <SOInvoice.refNbr, Equal <Required <SOInvoice.refNbr> > > > > .Select(rg, invoice.DocType, invoice.RefNbr);

                return(rg.CalculateExternalTax(rg.Document.Current));
            }
            else
            {
                var rg = LazyArInvoiceEntry.Value;
                rg.Clear();

                rg.Document.Current = PXSelect <ARInvoice, Where <ARInvoice.docType, Equal <Required <ARInvoice.docType> >, And <ARInvoice.refNbr, Equal <Required <ARInvoice.refNbr> > > > > .Select(rg, invoice.DocType, invoice.RefNbr);

                return(rg.CalculateExternalTax(rg.Document.Current));
            }
        }
コード例 #11
0
        public virtual IEnumerable ViewARDocument(PXAdapter adapter)
        {
            CABatchDetail doc = this.BatchPayments.Current;

            if (doc != null)
            {
                ARRegister arDoc = PXSelect <ARRegister,
                                             Where <ARRegister.docType, Equal <Required <ARRegister.docType> >,
                                                    And <ARRegister.refNbr, Equal <Required <ARRegister.refNbr> > > > > .Select(this, doc.OrigDocType, doc.OrigRefNbr);

                if (arDoc != null)
                {
                    ARPaymentEntry apGraph = PXGraph.CreateInstance <ARPaymentEntry>();
                    apGraph.Document.Current = apGraph.Document.Search <ARRegister.refNbr>(arDoc.RefNbr, arDoc.DocType);
                    if (apGraph.Document.Current != null)
                    {
                        throw new PXRedirectRequiredException(apGraph, true, "")
                              {
                                  Mode = PXBaseRedirectException.WindowMode.NewWindow
                              }
                    }
                    ;
                }
            }
            return(adapter.Get());
        }
コード例 #12
0
        public virtual void CreateEquipments(SMEquipmentMaint graphSMEquipmentMaint,
                                             ARRegister arRegisterRow,
                                             Dictionary <int?, int?> newEquiments)
        {
            var inventoryItemSet = PXSelectJoin <InventoryItem,
                                                 InnerJoin <ARTran,
                                                            On <ARTran.inventoryID, Equal <InventoryItem.inventoryID>,
                                                                And <ARTran.tranType, Equal <ARDocType.invoice> > >,
                                                            LeftJoin <SOLine,
                                                                      On <SOLine.orderType, Equal <ARTran.sOOrderType>,
                                                                          And <SOLine.orderNbr, Equal <ARTran.sOOrderNbr>,
                                                                               And <SOLine.lineNbr, Equal <ARTran.sOOrderLineNbr> > > > > >,
                                                 Where <
                                                     ARTran.tranType, Equal <Required <ARInvoice.docType> >,
                                                     And <ARTran.refNbr, Equal <Required <ARInvoice.refNbr> >,
                                                          And <FSxEquipmentModel.eQEnabled, Equal <True>,
                                                               And <FSxARTran.equipmentAction, Equal <ListField_EquipmentAction.SellingTargetEquipment>,
                                                                    And <FSxARTran.sMEquipmentID, IsNull,
                                                                         And <FSxARTran.newTargetEquipmentLineNbr, IsNull,
                                                                              And <FSxARTran.componentID, IsNull> > > > > > >,
                                                 OrderBy <
                                                     Asc <ARTran.tranType,
                                                          Asc <ARTran.refNbr,
                                                               Asc <ARTran.lineNbr> > > > >
                                   .Select(Base, arRegisterRow.DocType, arRegisterRow.RefNbr);

            Create_Replace_Equipments(graphSMEquipmentMaint, inventoryItemSet, arRegisterRow, newEquiments, ID.Equipment_Action.SELLING_TARGET_EQUIPMENT);
        }
コード例 #13
0
 public static ARRegister Select(PXGraph graph, ARRegister payment)
 {
     if (payment == null || payment.RefNbr == null || payment.DocType == null)
     {
         return(null);
     }
     return(Select(graph, ARPaymentType.GetVoidingARDocType(payment.DocType), payment.DocType, payment.RefNbr));
 }
コード例 #14
0
        public virtual void OpenInvoiceAndRecoverBalances(ARRegister ardoc, Action <ARRegister> baseMethod)
        {
            if (ardoc.IsUnderCorrection == true)
            {
                throw new PXException(Messages.OnlyCancelCreditMemoCanBeApplied, ardoc.RefNbr);
            }

            baseMethod(ardoc);
        }
コード例 #15
0
        private static bool CheckForOpenPayments(PXGraph aGraph, string aStatementCycleID)
        {
            ARRegister doc = PXSelectJoin <ARPayment,
                                           InnerJoin <Customer, On <ARPayment.customerID, Equal <Customer.bAccountID> > >,
                                           Where <Customer.statementCycleId, Equal <Required <Customer.statementCycleId> >,
                                                  And <ARPayment.openDoc, Equal <CS.boolTrue> > > > .SelectWindowed(aGraph, 0, 1, aStatementCycleID);

            return(doc != null);
        }
コード例 #16
0
 public virtual void ReverseInvoiceProc(ARRegister doc, ReverseInvoiceProcDelegate baseMethod)
 {
     baseMethod(doc);
     Base.Document.SetValueExt <ARInvoiceRUTROT.isRUTROTDeductible>(Base.Document.Current, false);
     foreach (ARTran tran in Base.Transactions.Select())
     {
         Base.Transactions.SetValueExt <ARTranRUTROT.isRUTROTDeductible>(tran, false);
     }
 }
コード例 #17
0
 protected static void Copy(ARStatementDetail aDest, ARRegister aSrc)
 {
     aDest.DocType        = aSrc.DocType;
     aDest.RefNbr         = aSrc.RefNbr;
     aDest.BranchID       = aSrc.BranchID;
     aDest.DocBalance     = aSrc.DocBal;
     aDest.CuryDocBalance = aSrc.CuryDocBal;
     aDest.IsOpen         = aSrc.OpenDoc;
 }
コード例 #18
0
        public SupplyRecord Build(TExtendedInvoice extendedInvoice, ARRegister register, ARTran tran, ARTax tranTax, Customer customer, int lineNumber)
        {
            var supplyRecord = BuildInternal(register, tran, tranTax, lineNumber);

            _supplyRecordBuilderByCustomerData.Build(supplyRecord, register, customer);

            _countryBuilder.Build(supplyRecord, extendedInvoice);

            return(supplyRecord);
        }
コード例 #19
0
        private static bool CheckForUnreleasedCharges(PXGraph aGraph, string aStatementCycleID)
        {
            ARRegister doc = PXSelectJoin <ARRegister,
                                           InnerJoin <Customer, On <ARRegister.customerID, Equal <Customer.bAccountID> > >,
                                           Where <ARRegister.docType, Equal <ARDocType.finCharge>,
                                                  And <ARRegister.released, Equal <BQLConstants.BitOff>,
                                                       And <Customer.statementCycleId, Equal <Customer.statementCycleId> > > > > .SelectWindowed(aGraph, 0, 1, aStatementCycleID);

            return(doc != null);
        }
コード例 #20
0
        public virtual void ARInvoiceCreated(ARInvoice invoice, ARRegister doc, ARInvoiceEntry.ARInvoiceCreatedDelegate baseMethod)
        {
            baseMethod(invoice, doc);

            RUTROT rutrot = PXSelect <RUTROT, Where <RUTROT.docType, Equal <Required <ARRegister.docType> >,
                                                     And <RUTROT.refNbr, Equal <Required <ARRegister.refNbr> > > > > .Select(Base, doc.DocType, doc.RefNbr);

            rutrot = RUTROTHelper.CreateCopy(Base.Rutrots.Cache, rutrot, invoice.DocType, invoice.RefNbr);
            rutrot = Base.Rutrots.Update(rutrot);
        }
コード例 #21
0
        protected virtual bool CreateAndReleaseCancellationInvoice(ARRegister doc, int index, bool isMassProcess)
        {
            if (doc.IsCorrection != true)
            {
                return(true);
            }

            try
            {
                var invoiceGraph = PXGraph.CreateInstance <SOInvoiceEntry>();

                ARInvoice existingCancellationInvoice = PXSelect <ARInvoice,
                                                                  Where <ARInvoice.origDocType, Equal <Current <ARInvoice.origDocType> >,
                                                                         And <ARInvoice.origRefNbr, Equal <Current <ARInvoice.origRefNbr> >,
                                                                              And <ARInvoice.isCancellation, Equal <True> > > > >
                                                        .SelectSingleBound(invoiceGraph, new[] { doc });

                if (existingCancellationInvoice != null)
                {
                    if (existingCancellationInvoice.Released != true)
                    {
                        throw new PXException(Messages.CancellationInvoiceExists, existingCancellationInvoice.RefNbr, doc.RefNbr);
                    }
                    else
                    {
                        return(true);
                    }
                }

                invoiceGraph.GetExtension <Correction>().CancellationInvoiceCreationOnRelease = true;
                invoiceGraph.Document.Current = invoiceGraph.Document.Search <ARInvoice.refNbr>(doc.OrigRefNbr, doc.OrigDocType);
                invoiceGraph.Actions[nameof(cancelInvoice)].Press();

                using (var scope = new PXTransactionScope())
                {
                    invoiceGraph.Save.Press();

                    invoiceGraph.ReleaseInvoiceProc(
                        new List <ARRegister> {
                        invoiceGraph.Document.Current
                    },
                        isMassProcess: false);

                    scope.Complete();
                }

                return(true);
            }
            catch (PXException e) when(isMassProcess)
            {
                PXProcessing <ARRegister> .SetError(index, e);

                return(false);
            }
        }
コード例 #22
0
        protected static void AccumulateAgeBalances(ARStatement statement, ARRegister document, bool ageCredits)
        {
            ARInvoice inv = document as ARInvoice;

            //ARDocType.SmallCreditWO - is an invoice, but it must be processed as payment
            int days = 0;

            if (inv != null && inv.DocType != ARDocType.SmallCreditWO)
            {
                TimeSpan diff = (statement.StatementDate.Value.Subtract(inv.DueDate.Value));
                days = diff.Days;
            }
            else
            {
                TimeSpan diff = (statement.StatementDate.Value.Subtract(document.DocDate.Value));
                days = diff.Days;
            }
            if ((inv != null && inv.DocType != ARDocType.SmallCreditWO) || ageCredits)
            {
                Decimal docBal     = ((bool)document.Paying) ? -document.DocBal.Value : document.DocBal.Value;
                Decimal curyDocBal = ((bool)document.Paying) ? -document.CuryDocBal.Value : document.CuryDocBal.Value;
                if (days <= 0)
                {
                    statement.AgeBalance00     = (statement.AgeBalance00 ?? Decimal.Zero) + docBal;
                    statement.CuryAgeBalance00 = (statement.CuryAgeBalance00 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!statement.AgeDays00.HasValue || days <= statement.AgeDays01)
                {
                    statement.AgeBalance01     = (statement.AgeBalance01 ?? Decimal.Zero) + docBal;
                    statement.CuryAgeBalance01 = (statement.CuryAgeBalance01 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!statement.AgeDays01.HasValue || days <= statement.AgeDays02)
                {
                    statement.AgeBalance02     = (statement.AgeBalance02 ?? Decimal.Zero) + docBal;
                    statement.CuryAgeBalance02 = (statement.CuryAgeBalance02 ?? Decimal.Zero) + curyDocBal;
                }
                else if (!statement.AgeDays02.HasValue || days <= statement.AgeDays03)
                {
                    statement.AgeBalance03     = (statement.AgeBalance03 ?? Decimal.Zero) + docBal;
                    statement.CuryAgeBalance03 = (statement.CuryAgeBalance03 ?? Decimal.Zero) + curyDocBal;
                }
                else
                {
                    statement.AgeBalance04     = (statement.AgeBalance04 ?? Decimal.Zero) + docBal;
                    statement.CuryAgeBalance04 = (statement.CuryAgeBalance04 ?? Decimal.Zero) + curyDocBal;
                }
            }
            else
            {
                //Payments, when credits are not aged
                statement.AgeBalance04     = statement.AgeBalance04 - document.DocBal;             //After completion we must apply resedual payments to previous buckets
                statement.CuryAgeBalance04 = statement.CuryAgeBalance04 - document.CuryDocBal;
            }
        }
        public static void ReleaseARDocument(IBqlTable aTable)
        {
            ARRegister toProc = (ARRegister)aTable;

            if (!(toProc.Released ?? false))
            {
                List <ARRegister> list = new List <ARRegister>(1);
                list.Add(toProc);
                ARDocumentRelease.ReleaseDoc(list, false);
            }
        }
コード例 #24
0
        public virtual ARRegister OnBeforeRelease(ARRegister ardoc, OnBeforeReleaseDelegate del)
        {
            ValidatePostBatchStatus(PXDBOperation.Update, ID.Batch_PostTo.AR, ardoc.DocType, ardoc.RefNbr);

            if (del != null)
            {
                return(del(ardoc));
            }

            return(null);
        }
コード例 #25
0
        private void UpdateOriginalSingleSchedule(ARRegister originalDocument, decimal amount)
        {
            foreach (PXResult <ARTran, InventoryItem, INComponent, DRDeferredCode> item in ARTransactionWithItems.Select())
            {
                ARTran         artran        = item;
                InventoryItem  inventoryItem = item;
                INComponent    component     = item;
                DRDeferredCode deferredCode  = item;

                UpdateOriginalSchedule(artran, deferredCode, amount, originalDocument.DocDate, originalDocument.FinPeriodID, originalDocument.CustomerID, originalDocument.CustomerLocationID);
            }
        }
コード例 #26
0
        protected void _(Events.FieldSelecting <ARTranForDirectInvoiceExt.usrGUINbr> e)
        {
            var row = e.Row as ARTranForDirectInvoice;

            if (row != null)
            {
                ARRegister register = SelectFrom <ARRegister> .Where <ARRegister.docType.IsEqual <@P.AsString>
                                                                      .And <ARRegister.refNbr.IsEqual <@P.AsString> > > .View.ReadOnly.Select(Base, row.TranType, row.RefNbr);

                e.ReturnValue = register.GetExtension <ARRegisterExt>().UsrGUINbr;
            }
        }
コード例 #27
0
        private ComplianceDocumentReference CreateComplianceDocumentReference(ARRegister invoice)
        {
            var reference = new ComplianceDocumentReference
            {
                ComplianceDocumentReferenceId = Guid.NewGuid(),
                Type            = invoice.DocType,
                ReferenceNumber = invoice.RefNbr,
                RefNoteId       = invoice.NoteID
            };

            return(DocumentReference.Insert(reference));
        }
コード例 #28
0
        public virtual void CloseInvoiceAndClearBalances(ARRegister ardoc, int?adjNbr, CloseInvoiceAndClearBalancesDelegate baseMethod)
        {
            RSSVWorkOrder order = SelectFrom <RSSVWorkOrder> .Where <RSSVWorkOrder.invoiceNbr.IsEqual <ARRegister.refNbr.FromCurrent> > .View.SelectSingleBound(Base, new[] { ardoc });

            if (order != null)
            {
                order.Status = WorkOrderStatusConstants.Paid;
                UpdWorkOrder.Update(order);
                Base.Persist();
            }

            baseMethod(ardoc, adjNbr);
        }
コード例 #29
0
        public override void UpdateARBalances(PXCache cache, object newRow, object oldRow)
        {
            if (oldRow != null)
            {
                ARRegister oldARRow = Document.Cache.GetMain((Document)oldRow) as ARRegister;
                ARReleaseProcess.UpdateARBalances(cache.Graph, (ARRegister)oldARRow, -((ARRegister)oldARRow).OrigDocAmt);
            }

            if (newRow != null)
            {
                ARRegister newARRow = Document.Cache.GetMain((Document)newRow) as ARRegister;
                ARReleaseProcess.UpdateARBalances(cache.Graph, (ARRegister)newARRow, ((ARRegister)newARRow).OrigDocAmt);
            }
        }
コード例 #30
0
        public static bool Verify(PXGraph graph, ARRegister payment)
        {
            bool?  result = null;
            object value  = null;

            new HasUnreleasedVoidPayment <ARRegister.docType, ARRegister.refNbr>().Verify(
                graph.Caches[payment.GetType()],
                payment,
                new List <object>(0),
                ref result,
                ref value);

            return(result == true);
        }