Lc Create Modify

Lc Create Modify

Doubts

  • This Bill of Exchange is Live and may not be deleted –> this we will check using connected docs

Bill of Exchange (BOE)

Create Operation

LabelPropertyNotes
BE DetailsBEDetailsRequired field
DatedatedRequired, defaults to current date
Due DateBEDuedateRequired, defaults to current date
Party NamepartyidRequired, from party dropdown

Modify Operation

LabelPropertyNotes
BE NoBENoReadonly, cannot be modified
Party NamePartyNameReadonly, cannot be modified
BE DetailsBEDetailsCan be modified
DatedatedCan be modified
Due DateBEDuedateCan be modified

Delete Operation

  • All delete operations require a delete reason
  • Deletions are logged in the audit trail
  • Delete reason is mandatory for audit compliance
  • Validation: This Bill of Exchange is Live and may not be deleted

SQL Queries for BOE

Create BOE

INSERT INTO BE (BENo, BEDetails, dated, BEDuedate, partyid)
VALUES (@BENo, @BEDetails, @dated, @BEDuedate, @partyid)

Modify BOE

UPDATE BE SET BEDetails=@BEDetails, dated=@dated, BEDuedate=@BEDuedate
WHERE id=@id

Delete BOE

DELETE FROM BE WHERE id = @id

Validation Rules for BOE

OperationFieldValidation RuleError Message
Create/ModifyBEDetailsRequired, MaxLength(75)BE Details needs to be filled
Create/ModifyBEDuedateRequired, > datedDue date cannot be less than {dated}
Create/ModifyBEDuedateRequired, < dated + 100 daysBEDuedate cannot exceed {maxduedate}
Create/ModifypartyidRequiredParty needs to be selected

Letter of Credit (LC)

Create Operation

LabelPropertyNotes
LC DetailsLcDetailsRequired, MaxLength(75)
DatedatedRequired, defaults to current date
Party NamepartyidRequired, from party component
CurrencycurrencyRequired, from currency dropdown
Conversion RateconversionrateRequired, max 999.9999
AmountamountRequired, max 99999999.99
TolerancetoleranceRequired, max 999
Valid Upto DatevaliduptoRequired, defaults to current date
Last Shipment DateshipdateOptional, defaults to current date
NotesnotesOptional

Modify Operation

LabelPropertyNotes
LC NumberLcNoReadonly, cannot be modified
LC DetailsLcDetailsCan be modified
DatedatedCan be modified
Valid Upto DatevaliduptoCan be modified
CurrencycurrencyCan be modified
Conversion RateconversionrateCan be modified
AmountamountCan be modified
Tolerance %toleranceCan be modified
Valid UptovaliduptoCan be modified
LC StatusstatusCan be modified
Last Ship DateshipdateCan be modified
NotesnotesCan be modified

Delete Operation

  • Delete reason is required

SQL Queries for LC

Create LC

INSERT INTO LC (LCNo, LCDetails, dated, partyid, currency, conversionrate, amount,
tolerance, validupto, yearlcno, status, notes, shipdate)
VALUES (@LCNo, @LCDetails, @dated, @partyid, @currency, @conversionrate, @amount, @tolerance,
@validupto, @yearlcno, @status, @notes, @shipdate)

Modify LC

UPDATE LC SET LCDetails=@LCDetails, dated=@dated, currency=@currency, conversionrate=@conversionrate,
amount=@amount, tolerance=@tolerance, validupto=@validupto, status=@status,
shipdate=@shipdate, notes=@notes
WHERE id=@id

Delete LC

DELETE FROM LC WHERE id = @id

Validation Rules for LC

OperationFieldValidation RuleError Message
Create/ModifyLcDetailsRequired, MaxLength(75)LC Details needs to be filled
Create/ModifyvaliduptoRequired, between dated and dated + 1 yearValid Upto date must be between {dated} and {dated+1year}
Create/ModifycurrencyRequiredCurrency needs to be filled
Create/ModifyconversionrateRequired, Range(0.0001, 999.9999)Conversion Rate must be between 0.0001 and 999.9999
Create/ModifyamountRequired, Range(1, 99999999.99)Amount must be between 1 - 99999999.99
Create/ModifytoleranceRequiredTolerance needs to be filled
Create/ModifypartyidRequiredParty needs to be selected
ModifyamountAmount + tolerance >= total bill amountLC amount (plus tolerance) must be more than total amount of bills

Link BOE

  • This feature will be on LC details page as a link
  • When user clicks this link, it will redirect to a new razor page LCBeoLinkIndex
  • In that razor page, show all BE with same party along with checkboxes to link them
  • After user selects the BOE, insert them into a new table LinkLcBoe

Create Table

CREATE TABLE LinkLcBoe (
    id INT PRIMARY KEY IDENTITY(1,1),
    yearlcno NVARCHAR(12),
    yearbeono NVARCHAR(12)
);

Query for LCBeoLinkIndex

SELECT BENo, dated, partyid
FROM BE
WHERE partyid=@partyid AND CONVERT(DATE,dated)>=CONVERT(DATE,@dated)