Work on Outbound Invoice; icons
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -226,7 +226,9 @@
|
||||
<ResourceKey>Financial_SendInvoice</ResourceKey>
|
||||
<UserLevel>2</UserLevel>
|
||||
<Permissions />
|
||||
<Type>Disabled</Type>
|
||||
<ImageUrl>iconshock-invoice-outbound</ImageUrl>
|
||||
<NavigateUrl>/Pages/v5/Financial/CreateOutboundInvoice.aspx</NavigateUrl>
|
||||
<Type>Link</Type>
|
||||
<Children />
|
||||
</MainMenuItem>
|
||||
|
||||
@@ -234,7 +236,7 @@
|
||||
<ResourceKey>Financial_ReceivedInvoice</ResourceKey>
|
||||
<UserLevel>3</UserLevel>
|
||||
<Permissions />
|
||||
<ImageUrl>iconshock-invoice</ImageUrl>
|
||||
<ImageUrl>iconshock-invoice-inbound</ImageUrl>
|
||||
<NavigateUrl>/Pages/v5/Financial/CreateInboundInvoice.aspx</NavigateUrl>
|
||||
<Type>Link</Type>
|
||||
<Children />
|
||||
|
||||
@@ -160,25 +160,47 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
throw new InvalidOperationException ("No documents uploaded");
|
||||
}
|
||||
|
||||
OutboundInvoice invoice = OutboundInvoice.Create (CurrentOrganization, dueDate, budget, this.TextClient.Text, string.Empty, string.Empty, CurrentOrganization.Currency, false, this.TextReference.Text, CurrentUser);
|
||||
OutboundInvoice newInvoice = OutboundInvoice.Create (CurrentOrganization, dueDate, budget, this.TextClient.Text, string.Empty, string.Empty, CurrentOrganization.Currency, false, this.TextReference.Text, CurrentUser);
|
||||
|
||||
invoice.AddItem(this.TextPurpose.Text, amountCents);
|
||||
newInvoice.AddItem(this.TextPurpose.Text, amountCents);
|
||||
|
||||
// TODO: VAT -- needs to be PER ITEM, and dbfields must update for this, quite a large work item, do not short circuit hack this
|
||||
|
||||
documents.SetForeignObjectForAll(invoice);
|
||||
|
||||
documents.SetForeignObjectForAll(newInvoice);
|
||||
|
||||
// Create financial transaction in the ledger (this logic should not be in the presentation layer at all, move it to a better OutboundInvoice.Create that takes OutboundInvoiceItems as parameter)
|
||||
|
||||
FinancialTransaction txOut = FinancialTransaction.Create(CurrentOrganization, DateTime.UtcNow,
|
||||
"Outbound Invoice #" + newInvoice.Identity.ToString("N0"));
|
||||
|
||||
txOut.AddRow(CurrentOrganization.FinancialAccounts.AssetsOutboundInvoices, amountCents, CurrentUser);
|
||||
if (amountVatCents > 0)
|
||||
{
|
||||
txOut.AddRow(CurrentOrganization.FinancialAccounts.DebtsVatOutboundUnreported, amountVatCents,
|
||||
CurrentUser);
|
||||
txOut.AddRow(budget, -(amountCents - amountVatCents), CurrentUser); // Sales value
|
||||
}
|
||||
else
|
||||
{
|
||||
txOut.AddRow(budget, amountCents, CurrentUser);
|
||||
}
|
||||
|
||||
|
||||
// Make the transaction dependent on the inbound invoice
|
||||
|
||||
txOut.Dependency = newInvoice;
|
||||
|
||||
// If invoice is denominated in a non-presentation currency, record the native values for proper payment
|
||||
|
||||
if (this.CurrencyAmount.NonPresentationCurrencyUsed)
|
||||
{
|
||||
Money currencyEntered = this.CurrencyAmount.NonPresentationCurrencyAmount;
|
||||
invoice.NativeCurrencyAmount = currencyEntered;
|
||||
newInvoice.NativeCurrencyAmount = currencyEntered;
|
||||
}
|
||||
|
||||
// Display success message
|
||||
|
||||
this._invoiceId = invoice.Identity; // a property returns the localized string
|
||||
this._invoiceId = newInvoice.Identity; // a property returns the localized string
|
||||
|
||||
// Reset all fields for next invoice
|
||||
|
||||
|
||||
@@ -972,6 +972,8 @@
|
||||
<Content Include="Images\PageIcons\iconshock-invoice-40px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-invoice-greentick-16px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-invoice-greentick-40px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-invoice-inbound-96px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-invoice-outbound-96px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-language-40px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-ledger-16px.png" />
|
||||
<Content Include="Images\PageIcons\iconshock-ledger-40px.png" />
|
||||
|
||||
Reference in New Issue
Block a user