Skip to content

Commit c0e4bfc

Browse files
allmightyspiffGitHub Enterprise
authored andcommitted
Merge pull request #908 from SoftLayer/issues902
Updated 'account invoices' help text
2 parents 18fe50d + 290ab1c commit c0e4bfc

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

plugin/commands/account/invoices.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package account
22

33
import (
4+
"fmt"
45
"github.com/spf13/cobra"
56

67
"github.ibm.com/SoftLayer/softlayer-cli/plugin/errors"
@@ -27,6 +28,14 @@ func NewInvoicesCommand(sl *metadata.SoftlayerCommand) *InvoicesCommand {
2728
cobraCmd := &cobra.Command{
2829
Use: "invoices",
2930
Short: T("List invoices."),
31+
Long: T("Lists the most recent invoices in the OPEN status."),
32+
Example: fmt.Sprintf(`${COMMAND_NAME} sl account invoices --all
33+
%s
34+
35+
${COMMAND_NAME} sl account invoices --limit 100 --closed
36+
%s`,
37+
T(`Lists all open and closed invoices on the account.`),
38+
T(`Lists 100 invoices, ordered by latest create date, including invoices in the CLOSED status.`)),
3039
Args: metadata.NoArgs,
3140
RunE: func(cmd *cobra.Command, args []string) error {
3241
return thisCmd.Run(args)

plugin/i18n/v2Resources/active.en-US.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,6 +4421,9 @@
44214421
"List {{.storageType}} storage snapshots": {
44224422
"other": "List {{.storageType}} storage snapshots"
44234423
},
4424+
"Lists 100 invoices, ordered by latest create date, including invoices in the CLOSED status.": {
4425+
"other": "Lists 100 invoices, ordered by latest create date, including invoices in the CLOSED status."
4426+
},
44244427
"Lists Email Delivery Service.": {
44254428
"other": "Lists Email Delivery Service."
44264429
},
@@ -4430,9 +4433,15 @@
44304433
"Lists account orders.": {
44314434
"other": "Lists account orders."
44324435
},
4436+
"Lists all open and closed invoices on the account.": {
4437+
"other": "Lists all open and closed invoices on the account."
4438+
},
44334439
"Lists billing items with some other useful information.": {
44344440
"other": "Lists billing items with some other useful information."
44354441
},
4442+
"Lists the most recent invoices in the OPEN status.": {
4443+
"other": "Lists the most recent invoices in the OPEN status."
4444+
},
44364445
"Lists the prices for each item in this preset": {
44374446
"other": "Lists the prices for each item in this preset"
44384447
},

plugin/managers/account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (a accountManager) GetInvoices(limit int, closed bool, getAll bool) ([]data
184184
mask := "mask[invoiceTotalAmount, itemCount]"
185185
filters := filter.New()
186186
filters = append(filters, filter.Path("invoices.id").OrderBy("DESC"))
187-
if !closed {
187+
if !closed || !getAll {
188188
filters = append(filters, filter.Path("invoices.statusCode").Eq("OPEN"))
189189
}
190190
resourceList := []datatypes.Billing_Invoice{}

0 commit comments

Comments
 (0)